Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameter by reference
Message
From
08/09/2011 10:43:32
 
 
To
08/09/2011 10:34:22
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01522925
Message ID:
01523020
Views:
48
>>The problem with current List Memory format is even if the caller argument is passed by reference and List Memory hides it. The callee can not check this because it would not know the caller's argument variable name.
>
>Actually... tried this:
>
>
private ShouldBeHidden
>LOCAL IsLocal
>ShouldBeHidden="this is private"
>isLocal="this is local"
>do trythis with ShouldBeHidden, isLocal
>
>procedure trythis(tuVisible, tuInvisible)
>	list memory TO tmp.txt
>
>and got this:
>
>ISLOCAL     Local  C  "this is local"  hidden_private
>SHOULDBEHIDDEN
>            (hid)  C  "this is private"  hidden_private
>TUVISIBLE   Local  shouldbehidden
>TUINVISIBLE
>            Local  islocal
>    4 variables defined,    42 bytes used
>
>When I called it as a function, got this:
>
TUVISIBLE   Local  C  "this is private"  trythis
>TUINVISIBLE
>            Local  C  "this is local"  trythis
>
>When I called it as trythis(@ShouldBeHidden, isLocal), I got
>
ISLOCAL     Local  C  "this is local"  hidden_private
>SHOULDBEHIDDEN
>            (hid)  C  "this is private"  hidden_private
>TUINVISIBLE
>            Local  C  "this is local"  trythis
>TUVISIBLE   Local  shouldbehidden
>So a list memory like (prefix for parameters) should find the original variables and list them instead of the current procedure name if by ref, or the procedure name if by value... Interesting. Not sure if this would work the same in a form and all possible scenarios (within execscript, code called from a menu clause like skipfor, stored procedure, function call within a sql statement etc etc), but may be worth investigating.

Yes, interesting and worth investigating. Anyway, I have decided to use a different approuch to resolve the problem. Thanks all.
Greg Reichert
Previous
Reply
Map
View

Click here to load this message in the networking platform