Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Losing Public Variables When Form Runs
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00231160
Message ID:
00232143
Vues:
23
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform