Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's the secret meaning of this piece of code?
Message
De
03/08/1997 12:01:32
 
 
À
03/08/1997 10:10:11
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00042899
Message ID:
00042987
Vues:
41
In your sample: MyVar is private in LowerProc. But, because by default params are passed by reference to procedures (by value to functions), MyVar will be changed at the calling level. So, the params passing method is responsible for the change and not the scope of params. The MyVar variable will not change if:

public MyVar, Myvar1
Myvar = 12
MyVar1 = 20

do lowerproc with MyVar1

In this case, at the calling level, MyVar will not change, MyVar1 will change.

BTW, I will never understand why params are passed by reference to procs and by value to functions. Why this difference? Can anyone give a good reason?

Vlad

>I wonder if PARAMETERS is just enough to make a variable PRIVATE to only one PROC.
>
>public myvar
>myvar = 12
>
>do lowerproc with myvar
>do anotherproc
>
>
>proc lowerproc
>PARAMETERS myvar
>myvar = 25
>
>proc anotherproc
>? myvar
>
>Cetin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform