Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public or Private
Message
From
30/09/1997 10:21:29
 
 
To
30/09/1997 00:57:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00052342
Message ID:
00052403
Views:
34
I played with that idea last night and found that what you just confirmed for me is true. I will continue to declare all my variables as private just in case I happen to use the same name as a public variable. Thanks for you reply. Andy > >>I have been told that any variable in a program (*.prg file) is >>private unless declared as public. Is this true? Variables I make > >Yes and no. If the variable doesn't exist at previous calling level, the >variable is private by default. If the variable exists at previous level, >this variable is used, so, it's not private at the level you are. > >The "private" status depends on the level the variable is defined/used. Ie, >a variable may be private at the level where is defined or used for the >first time, but is not private at any level that is called from the current >level. > >It's a very good practice to define all variables that you want private >with an explicit PRIVATE definition, preferably at the begining of the >function/procedure. > >This insures you that the variables are private where you want them to be >private and offers a place where you can see all used variables in a >procedure. > >Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform