Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameter by reference
Message
De
08/09/2011 10:43:32
 
 
À
08/09/2011 10:34:22
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01522925
Message ID:
01523020
Vues:
46
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform