Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to: Push and Pop parameters?
Message
 
 
À
18/10/2001 10:09:26
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00570224
Message ID:
00570310
Vues:
17
Hi Mike,
Could you give alittle more explanation of what's happening and why you need this? Can you do as George suggested along this thread of having two separate logic branches for variables passed as arrays and those that are not? Why would convert a string into an array in the first place?

When you pass a variable by reference, you are actually passing a pointer to the memory space that holds that variable. Anything you do to it, changes the information in that memory space. When you copy an array into it, you change the structure of what is stored there. At the end of Junk1, VFP thinks the memory location holds an array and treats it accordingly. I don't know of way to make it think otherwise.

BTW, if you release tuParameter before you assign luparamater to it, you kill the reference back to lcstring. When the assignation takes place, you are creating a new private memory variable called tuParameter.

>Hi All
>
>I need to pass a parameter to a method by reference. The called method may alter the parameter, so I want to push the parameter to a property. The parameter may be a string or an array to begin with. I don't believe the save and restore variables to memo fields / .mem files route would be feasible.
>
>The problem is, if an initial parameter is passed as a string and pushed to a property, and the called program changes the passed parameter to an array, it doesn't seem possible to pop the parameters so as to cause the array to become a string again.
>
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform