Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private Vars Declared in Init Scope
Message
De
16/12/2003 12:55:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
16/12/2003 12:27:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00859506
Message ID:
00859567
Vues:
11
This message has been marked as a message which has helped to the initial question of the thread.
>Ok, how would that be done if using DO FORM and not CREATEOBJECT? To my knowledge, there is no method on the form where you can declare variables that will persist for the life of the form, right (without declaring them public)? Typically, I create form properties as a general rule, but I'm in the middle of converting a ton of FPD26 screens and the code already exists to create the vars that are used in the screen in the old FPD26 screens setup and I'd like to use the vars instead of form properties to speed up the process for now. Any ideas short of running a prg to declare the vars that then calls the form?

Using variables is simply not practical. A variable is either private/local/non-declared, in which case it dies when the method finishes executing, or it is public, in which case it is visible in ALL forms, not only in the form you are working on. I assume you will want to have the capability of opening several forms at once, right?

The only simple way to define values which are visible in your entire form - and only there - is by using form properties.

For the conversion, I suggest you systematically replace all variables by equally-named form properties (MyVar becomes ThisForm.MyVar), and assign them in the Form.Init() (ThisForm.MyVar = MyVar).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform