Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public variables VS objects
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00795846
Message ID:
00796183
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
Rodolfo,

If the code you posted is followed somewhere by a READ EVENTS then the declaration of PUBLIC is NOT needed. Private variables are visible to the routine that creates them and all routines below that one in the calling stack, which is exactly what you want for a global variable (regardless as to whether that is a memvar or object reference).

The ONLY reason to declare a variable PUBLIC is to have it outlive the code that creates it, meaning that after the creating code is ended and returned from the var will continue to exist (which is a very bad design issue with serious potential side effects that will be very problematic to debug).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform