>>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
Thanks Matt. This is great. I was afraid to put calls to init in an init, but I hadn't thought of the step of adding the parameter to the object's init -- that would stop the recursion I feared.
Thanks again.
Valerie
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only