Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order of instantiation
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01292155
Message ID:
01292157
Views:
23
>I am trying to understand the order of instantiation and how to use it.
>
>Here is an example:
>
>Form Class A (base class, based on VFP form class). This class has a method to manipulate form controls (textboxes, buttons, labels, etc.). Let’s call this method MYMETHOD1(). But Form Class A has NO controls.
>
>Form Class B (based on Class A, above). This form has controls (textboxes, labels, pageframe, etc.) I need to call method MYMETHOD1() in INIT method of this class (class B). Should I first call DODEFAULT() to make sure that all controls are instantiated before calling MYMETHOD1()? Or VFP instantiate all controls first, by default?
>
>Thank you in advance for any help.

VFP always instantiates all controls first (their Init), then the form's Init fires.

E.g. from the inner most to the outer. This is true for any container as well. First controls initialize, then the container.

So, you may call dodefault() in Form's Init anywhere you're ready.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform