Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why are my local variables changed?
Message
De
01/09/1999 23:06:50
 
 
À
01/09/1999 20:45:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00260036
Message ID:
00260438
Vues:
14
>Hi Erik,
>
>>Check out the help for UDFPARMS...
>
>Try this:
>
>
Var = 'Passed by Value'
>do passcheck with Var
>wait window Var
>
>proc passcheck
>    lparam tVar
>    tVar = 'Passed by Reference'
>endproc
>
>Now Try
>
>Var = 'Passed by Value'
>do passcheck with (Var)
>wait window Var
>
>proc passcheck
>    lparam tVar
>    tVar = 'Passed by Reference'
>endproc
Notice the only differnce is the DO line. Am I missing the point again?

I don't think we're in disagreement. My point was that SET UDFPARMS doesn't affect parameters passed with a WITH clause after a DO statement. When you surround the parameter with parentheses, you are effectively passing a literal, instead of the actual variable. At runtime, the variable is evaluated before it is passed, and passed to the procedure in pure string form, so yes, it is effectively passed by value.
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform