Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can anyone explain DoDefault?
Message
De
09/09/2004 07:04:57
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00940368
Message ID:
00940536
Vues:
13
>I have seen this in articles, and coding all over the place. I have no idea what it means, when I should or shouldn't use it, or if it is even required.
>
>TIA
>
>DJ Hunt

And to add < bg > dodefault() is not needed for built-in events' baseclass code unless you used NODEFAULT. ie:

*Lostfocus is built-in.
this.Setfocus

This wouldn't work to keep focus on object as default lostfocus code (implicit dodefault) running after your code causes it to lose focus. Adding a NODEFAULT would do. Remember if you subclassed this object and adding code to lostfocus you're overriding only your parent class code not baseclass code.

Dodefault(parmsIfAny) can be called at any place (after,before or inline your overriding code) and as many times as you want in your code. It's as if you copy&pasted default class code there (rarely you might want to do it).

Assume you've init code in your grid class which provides entire row coloring. You put one grid from that class on to your form and decide you want to add dynamicfontbold in its init.

* Init
this.SetAll('DynamicFontBold',"(myAlias.myAmount > 1000)")

That'd provide dynamicfontbold but grid would lose its coloring defined in class. Then to provide it too you'd copy&paste the parent class code :

* Init
* Parentclass code
this.SetAll('DynamicFontBold',"(myAlias.myAmount > 1000)")

Dodefault() does that copy&paste :)

* Init
dodefault()
this.SetAll('DynamicFontBold',"(myAlias.myAmount > 1000)")

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform