Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling order of instantiation
Message
From
30/07/1997 17:35:09
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00042294
Message ID:
00042489
Views:
29
>>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
>Valerie,
>
>Depending on instantiation order is a desing flaw. The best way to handle you requirement is to let the Custom class act as a mediator for those objects and put the code in the Init of the Custom class to intervene between the other two classes. IOW, if I have two textboxes Text1 and Text2 in a Custom class I woudl write code like this in teh Custom class Init;
>
> THIS.Text2.ControlSource = IIF(THIS.Text1.ControlSource="FName", "LName","FName")
>
>This way this code is not in the init of Text2 where it would required that text1 was instanitated first, instead it is in the INit of the Contianre where we know all contained controls have been created.
Jim,
Hadn't seen this yet. I like this approach.
Gary
Gary
Helping Make Ideas Reality
Previous
Reply
Map
View

Click here to load this message in the networking platform