Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Destroying an object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00046886
Message ID:
00047935
Vues:
32
>Darrel,
>
>The only event method that I can think of that ahs any default behavior is the QueryUnload, its default behavior is to release the form and can be frustrated by either a NODEFAULT or a RETURN .F.
>
>DoDefault() can be problemsome if one isn't completely clear on what it does. It calls the code up the inheritence tree, but it also causes the default behavior of a method to fire as well. Where using the scope resolution operator will only call the specific class code that is referenced in the call.

Hi Darrel,

I'm a little confused. As far as I understand there are lots of methods that have default behaviour. Put NODEFAULT in MouseDown of a commandbutton and the button will not depress. Put NODEFAULT in LostFocus and you will not be able to leave the field. NODEFAULT in Gotfocus will prevent you from entering the field. NODEFAULT in keypress will prevent a key from being accepted. NODEFAULT in queryunload will prevent the form from being unloaded. As far as I can tell RETURN .F. doesn't do anything in queryunload.
My concern is that I can guess at what functionality I am preventing by using NODEFAULT but I cannot be sure that other more critical code is not being removed. Which is what prompted the request for documentation.

I have yet to find a use for the scope resolution operator, maybe its just style in which classes are built that dictates its use. When I create base classes it is because all subclasses have something in common, if I overload a method to specialize the subclass it should not change the fact that the default behaviour of the base class should still occur. If I do not want the default behaviour to occur I must question the use of the base class in the first place.


BFN,
Darrel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform