Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why are my local variables changed?
Message
From
01/09/1999 23:06:50
 
 
To
01/09/1999 20:45:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00260036
Message ID:
00260438
Views:
13
>Hi Erik,
>
>>Check out the help for UDFPARMS...
>
>Try this:
>
>
Var = 'Passed by Value'
>do passcheck with Var
>wait window Var
>
>proc passcheck
>    lparam tVar
>    tVar = 'Passed by Reference'
>endproc
>
>Now Try
>
>Var = 'Passed by Value'
>do passcheck with (Var)
>wait window Var
>
>proc passcheck
>    lparam tVar
>    tVar = 'Passed by Reference'
>endproc
Notice the only differnce is the DO line. Am I missing the point again?

I don't think we're in disagreement. My point was that SET UDFPARMS doesn't affect parameters passed with a WITH clause after a DO statement. When you surround the parameter with parentheses, you are effectively passing a literal, instead of the actual variable. At runtime, the variable is evaluated before it is passed, and passed to the procedure in pure string form, so yes, it is effectively passed by value.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform