Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Losing Public Variables When Form Runs
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00231160
Message ID:
00232143
Views:
22
Blenn,

Publics are often used when someone forgets that a private created at a higher calling level will do the same thing. If you create your oApp variable in the start up program as a private then it is visible to everything else in that app or called from that app. The only time a public is required is when a variable must be accessed by a program at a higher nesting level than the one creating the variable, and this is not good design. If the higher level routine needs the variable then it should be creating it and not some lower level called routine.

In my strup program there is only one situation where a publeic is used, that is when I run the app in development mode. I use a pbulic there because I don't issue the read eents so that VFP falls back to teh command window while my app is running. Thatw ay I can test and edit forms and the such interactively while the app is running.
Previous
Reply
Map
View

Click here to load this message in the networking platform