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:06:08
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00057866
Message ID:
00057872
Views:
29
>>>>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 ?
>
>This is part of the development standards. We have that in several places in the code. This is really a time saver. We only put the code without even worrying what is the parent or to have to put DODEFAULT().

OK, that sounds good.
Is there a way to place Method code in the Init event when the Ojbect is dropped on the form, or when it is edited. Like FoxPro adds lparameters to the Error event when you open it ? I would like to add a remark to the Init event like
* no code here * Is that possible ?
Glenn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform