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:20:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
03/08/1997 12:01:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00042899
Message ID:
00042990
Vues:
34
>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
I bet a variable is NOT always private when passed as a PARAMETER if we are talking about older versions also.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform