Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DODEFAULT function for sub-classes
Message
De
26/02/2001 12:29:29
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00479534
Message ID:
00479603
Vues:
39
Hi Neeraj,
Couple of issues to add to the comments from Vlad and Nick.
Remember, if you care about the return value, it's up to you to pass it through.
LPARAMETERS nIndex
LOCAL RetVal
RetVal=DODEFAULT(m.nIndex)
IF m.RetVal
Subclass code here...perhaps setting RetVal to .F.
ENDIF
RETURN m.RetVal

Secondly, if the method has a default VFP behavior, it may get executed multiple times..., unless you remember NODEFAULT.
PROCEDURE Refresh()
* This is in a fourth level subsclass of a Form.
Subclass code.
NODEFAULT && Added 'cause otherwise the controls are
* refreshed twice!
RETURN DODEFAULT()
Likewise with the KeyPress of a control. If you DODEFAULT() twice with no NODEFAULT at all, you can get two letters for each kkeeyypprreess. Not good.


>We have a lot of subclasses and subclasses they got up four level of a class.
>
>Is it wise to place DODEFAULT() fucntion in any event that we modify at the form level. (Most of the time we know which class or subclass events have codes, hence we do add them those events). But what about the once where the parent does not have any event or method.
>
>If we do put the function in the object event even if the parent does not have any code, how does it effect the preformance.
>
>Is this a complie time issue (giving us a larger exe) or a run time performance issue.
>
>
>Any suggetion or comments.
>
>PS: We are trying to avoid the research/testing time at our end.
Charlie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform