Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - function inside a function.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

function inside a function.

 Post Reply Post Reply Page  <12
Author
Badaboem View Drop Down
Senior Member
Senior Member


Joined: 12 April 2002
Location: Netherlands
Status: Offline
Points: 600
Post Options Post Options   Thanks (0) Thanks(0)   Quote Badaboem Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2004 at 6:45am
never mind..
It works as i suspected. Thanks for helping out dpyers.

The only thing i had to add was call in front of BuildSQL (strTable, sarySearchWord).
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2004 at 10:16am

The only difference between a function and a subroutine is that a function returns a value and a subroutine doesn't have to.

You really shouldn't have to invoke either with a call in asp 3.0. A function should return abe able to be referenced just like any asp command that returns a value.

As an example, I commonly use a function to validate email addresses that returns true/false. -
Function IsEmail(ByRef asString)

I invoke it in mainline code as... 
If IsEmail(strEmailAddress) Then ...

I have a subroutine that pulls html from a remote page into a string
Sub LoadThePage(strPageText, strInputURL)

I invoke it in code by...
LoadThePage strPageText, strInputURL


Neither the function nor the sub require the call statement.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
Badaboem View Drop Down
Senior Member
Senior Member


Joined: 12 April 2002
Location: Netherlands
Status: Offline
Points: 600
Post Options Post Options   Thanks (0) Thanks(0)   Quote Badaboem Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2004 at 10:21am
Thanks for taking the time to explain.

Not having call in front of the sub ''function'' produced an error. Google lead me to the microsoft help pages explaining call had to be used in order to use ()

That's why I used it, but I will have a look at your explanations.
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2004 at 10:50am
The call is an older asp version hangover... but hey... if it ain't broke... don't fix it

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.