Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to always execute subclass method code
Message
 
À
02/11/1997 13:01:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00057866
Message ID:
00057870
Vues:
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 ?
Glenn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform