Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private vars
Message
 
To
01/06/2001 09:38:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00513736
Message ID:
00513742
Views:
13
>reading a recent post, I read ( then proved ) that if you declear a private var in you main program it will have golbal scope.
>
>WHY!!!?!?!?!
In VFP a private variable is scoped to the program that created it, and any subsequent program called from within this program. So, if you declare a PRIVATE variable in you main program is the same as declaring it GLOBAL.


>I don't understand why the deviation on something so primitive.
I think is for compatibility with previous versions of xBase languages. First versions of xBase languages only had public and private variables and "private" was the defaul scope.

However, now you can declare your variables as LOCAL and achieve the behavior that you are looking for.
Hector Correa
Previous
Reply
Map
View

Click here to load this message in the networking platform