Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Controlling order of instantiation
Message
De
30/07/1997 08:41:35
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, États-Unis
 
 
À
30/07/1997 08:32:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00042294
Message ID:
00042298
Vues:
28
>Hi all,
>
>Is there any way to control the order in which objects are instantiated in a class (in the class designer)? I want to place some code in the init event of an object of a custom class which must run before the init event of another object of the same class. Is there any way to do this?
>
>Thanks,
>Valerie

Objects are instantiated in the order that they are placed in a container/form. I'm pretty sure the only way to control it is to remove them and put them back in the order you want. You could cut and paste to another dummy form...

But I like this way better....in the init events for the objects requiring control, use something like...

PARAMETERS lCalledByForm

IF lCalledByForm
. {place init Code here}
ENDIF

RETURN lCalledByForm

In the Form.Init use something like

THISFORM.Object1.Init(.T.)
THISFORM.Object2.Init(.T.)
THISFORM.Object3.Init(.T.)

That way you control the initialization of each object from the init of the form

HTH

Matt
Matt McDonnell
...building a better mousetrap with moldy cheese...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform