Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public variables VS objects
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00795846
Message ID:
00796183
Vues:
17
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).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform