Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameter by reference
Message
From
09/09/2011 03:29:42
 
 
To
07/09/2011 15:38:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01522925
Message ID:
01523067
Views:
54
>Does anyone know of a way to determine if a variable has been passed to a function by reference or by value. This is a run-time question.
>For example:
>
>local a
>a='test'
>=Test(@a)
>=Test(a)
>
>procedure Text
>lparameter b
>*-- here, i would like to verify that the variable 'a' was passed to 'b' as by reference.
>...
>
The best you can do is this.
Obviously it's no use.
PRIVATE a
a='test'
=Testa(@a)
=Testa(a)
PUBLIC x
=Testx(@x)
=Testx(x)

procedure Testa
lparameter b
MESSAGEBOX("variable b "+IIF(VARTYPE(m.a)=='U',"Reference to a","is a stand-alone variable"))

procedure Testx
lparameter b
MESSAGEBOX("variable b "+IIF(VARTYPE(m.x)=='U',"Reference to x","is a stand-alone variable"))
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform