Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Init() method and hooks
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Init() method and hooks
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01120686
Message ID:
01120686
Vues:
51
Hi!
I've a form class named 'pvform'.

The init method looks like this
if !this.preInitHook()
    return .F.
endif

..my code..

this.postInitHook()
Ok, I think this a quite standard init(), but how would you handle the call to "postInitHook()" in a new class subclassed from pvform??

Let's say I have a class "pvformselection" based on "pvform".
This is the pvformselection init():
if !dodefault()
    return .F.
endif

..my code..

this.postInitHook()
Do you see?
The postInitHook would be called twice.

What if I write:
if !dodefault()
    return .F.
endif

..my code..

if this.class == "Pvformselection"
   this.postInitHook()
endif
Consequently in the pvform class I'd have:
if this.class == "Pvform"
   this.postInitHook()
endif
Actually I don't like it too much. :-)

Maybe in this case using an hook is not a good solution, and it's better to write directly in the Init() method.
What do you think?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform