Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to always execute subclass method code
Message
 
To
02/11/1997 13:01:36
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00057866
Message ID:
00057870
Views:
24
>>In my first subclass of a base class, can I always execute the method code there ?
>>Let's say in a grid, I have my Init event code, that must be executed. When another developer places code in the Init event of the subclassed object, they must use dodefault() or my code is not executed. Is there a way to force my code to be executed, unless a NODEFAULT is placed in the object ?
>
>Yes, one method that I use is like this. It mostly consists of using hooks.
>
>In a situation like this, when you want to avoid having to remember to put DODEFAULT(), using hooks may do the job.
>
>1. In your object, create a method like OurInit()
>2. In your object Init(), in the appropriate place, call This.OurInit()
>3. In your form, if init code should be handled, place it in OurInit()


Then all developers must agree not to use the Init method ?
Glenn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform