Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
>
>In summary, using public variables just to share data among form methods is not convenient. However, a few public variables in the main program may be justified. It should be possible to have a single public variable, an "application object", to store different kinds of data for your application; all kinds of data can be stored in different properties of the application object. (An application object might store user name and user level, a list of open forms, or any other information which you need once for the entire application.)
I'm not much of a theorist, and maybe we're saying the same thing differently, but it seems to me that public variables should be used only to share information between applications. If I want to create a variable which is scoped to the entire application, it would be declared Private in the main program.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement