Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to emulate Basic STATIC declaration in VFP?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00499761
Message ID:
00499766
Views:
16
>Moving some basic computations to VFP. The basic SUBs declare the passed variables STATIC. In the Basic watch window, when the SUB is called the passed variables retain their original value when returning to caller. In VFP, the passed variables (at least in the watch window) retained values as assigned by the sub. Should I simply change the name of the received variables in the VFP procedures - or - is there a declaration that will emmulate the Basic STATIC guy?
>
>As Always
>Terry

Terry,
It sounds like a diiference between passing variables by reference and passing them by value. By default in VFP, if you usie the following syntax:

do someproc with xx, yy

You are passing the variables by reference. If you do this:

someproc(xx,yy)

you are passing them by value. Without monkeying with the SET UDFPARAMS setting, you can bypass this behavior by doing the following:

do someproc with (xx),(yy) - passes by value
someproc(@xx,@yy) - passes by reference

Because it looks like you want the variables passed by value, choose whichever method gets you there.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform