>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...