Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How PUBLIC are public variables?
Message
From
25/04/2007 05:06:05
 
 
To
24/04/2007 11:49:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01219383
Message ID:
01219677
Views:
8
>I know public variables are to be used sparingly. Due to this I haven't used them much and know even less about them.
>
>I know that a public variable can get stomped on at any point in an application, since it's public, but does that also mean it can get stomped on by another user in a multi-user application?

As others already said: They cannot be stomped by another user.

But here's an advice: Declare such variables PRIVATE in the MAIN program. If you're using scope-denominators, use the letter g, indicating it's a global (rather than a public) variable. E.g. goMainWindow would be a nice variable name for an object reference to the main window.
* In main program:
private goMainWindow

goMainWindow = NULL

do form MainWindow name goMainWindow
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform