Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difficulty conceptualizing
Message
De
03/02/2004 09:15:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00873268
Message ID:
00873348
Vues:
25
Init() is called at the beginning, and is remotely comparable to the old Setup. Unload() is called when the form is closed, and can be remotely compared to the old Cleanup.

Two main differences are the following:

1) Startup is divided into two phases, Form.Load() and Form.Init().

Form.Load() executes before the Init() of contained objects. This is the ideal places to open tables (you can also use the form's DataEnvironment for this purpose, but in VFP6, for instance, this can't be inherited, so it is often better to use Load()).

2) Any variable declared in Load() or Init() loses its scope (and disappears, unless it is declared as public), as soon as the corresponding methods finish executing. These variables are not available throughout the lifetime of the form. If you accept any parameter in Form.Init(), you must copy it to a form property.

>VFP 101:
>
>1. Where do I put all the functions that in 2.6 used to be in the Cleanup code of the screen.spr which could be called from anywhere in the screen?
>
>2. Do I conceptualize the form.unload as the old cleanup and make calls to functions located there from other places in the form?
>If so, and if the function is called QQQ, what is the syntax?
>
>3. Do I conceptualize the Init as the Setup code where the variables used throughout the form are initialized and therefore "in scope" throughout the form? (either by direct creation or call to a Setup() method in the form)
>
>4. What, if anything, *has* to go, or normally goes, in the form.load method.
>
>5. If I'm going to reference something a few levels away, is there a utility/tool, etc. that will "grab" the (what is it called?) "path" ? reference? or must one type it once and then cut and paste?

It is best to redesign your forms from scratch.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform