Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Losing Public Variables When Form Runs
Message
 
To
19/06/1999 06:41:07
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00231160
Message ID:
00232150
Views:
18
Dragan,

The issue is not what the var is or what it does. It is that PUBLIC variables are bad news. They exist beyond the routine that creates them, they can cause conflicts far removed from their use (accidentally using a var with the same name). They continue to exist beyond the application ending (if you are running in the developers version of VFP.

There is only one thing that requires a public var, thast is that the var must be visible to some routine at a higher level in teh calling stack. If that is not needed then privates work just fine. A private created in the startup program is global to the entire application. Often folks confuse public with global. Globals must be visible to an entire application, while publics are visible to the entire app, so are privates created at the proper level. However, privates are protected from higher level routines.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform