Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When is NODEFAULT used?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00211090
Message ID:
00211155
Vues:
33
>I understand. But isn't the 'default' superclass method suppressed automatically, if I write code in the method, and do not add DODEFAULT()?
>Then it would be only needed to say NODEFAULT() if no code is added in the method, and I want to suppress the class behavior.
>Is this correct?

Chrsitian,

yes your class code is surpressed, but the default behavior of teh VFP baseclass is not surpressed.

For example, you write code in the keypress event of a textbox, if you had any code in a higher class's keypress that code would be surpressed. However, the processing of the keystroke by VFP is NOT surpressed by your code. That is the character will be added to the value of the textbox and the display will show it to the user. NODEFAULT does surpress the default base class behavior and in a keypress NODEFAULT will disard the keystroke.

NODEFAULT cna also be used to control when the base class default behavior occurs. By default it occurs after your code runs, however you could code akeypress event like this to force the default behavior first;
* Textbox KeyPress
DoDefault() * runs superclass AND baseclass behavior

* Some code you wrote

NODEFAULT
* surpresses automatic running of the base class default behavior
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform