Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's the secret meaning of this piece of code?
Message
From
03/08/1997 12:01:32
 
 
To
03/08/1997 10:10:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00042899
Message ID:
00042987
Views:
44
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform