Function parameters

Results 1 to 2 of 2

Thread: Function parameters

  1. #1
    Join Date
    Dec 1969

    Default Function parameters

    I have a function that gets passed in an address, validates it to ensure it is correct, and then returns a true or false... Some of the other paramters in the function get changed during the validation steps and I need access to them back where the function was called from, this does not seem to be working. Is there something specific I have to write in the function definition to make a variable passed by reference so they will be changed globally instead of just in the function itself?

  2. #2
    Join Date
    Dec 1969

    Default In the left panel of this page... on "VBScript Reference"<BR><BR>In the list of topics the appears, click on "Statements".<BR><BR>In the list of statements that appears, click on either "Function" or "Sub" statement.<BR><BR>Look down in the description to the part that discussed "ByVal" and "ByRef".<BR><BR>In short, if you *specify* in the declaration of the Sub/Function that an argument is passed "ByRef", then a change to it will be visible in the caller. If you specify "ByRef", the variable is truly local to the function/sub.<BR><BR>This is a pretty fundamental aspect of VBScript. I&#039;m really surprised that any ASP book wouldn&#039;t have a chapter or two on it.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts