Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty middle layer class - runs eldest method
Message
De
03/04/1999 03:23:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
02/04/1999 19:42:22
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00204785
Message ID:
00204906
Vues:
36
define class ggranpa as textbox
proc init
wait "I'm too old for this"
endproc
enddefine

>>DEFINE CLASS Grandpa AS ggranpa
>>PROCEDURE INIT
>> = MESSAGEBOX( 'Hi, we're in the myTextBox object init' )
>>END PROCEDURE
>>ENDDEFINE
>>
>>DEFINE CLASS Dad AS grandpa
>>ENDDEFINE
>>
>>DEFINE CLASS daughter AS dad
>>ENDDEFINE
>>
>>It is my understanding that the Grandpa object's init() *should* fire for the Daughter object since there is no code in it or its parent's method. Only if there is code in the daughter do you need a DODEFAULT in *her* init.
>>
>>As for the DOFAULT weirdness, I *think* I remember from a long and very interesting discussion somebody had with David Frankenbach, that if you have code in Daughter, and a DODEFAULT() in daughter and code in Grandpa, but the Dad.Init() is totally blank, then Dad won't "pass" the implicit DODEFAULT up to Grandpa.

I've made corrections to the code above to reflect my situation - and what's funny is that it skips the code in the grandpa, and executes the ggranpa.init right away. If I put

DEFINE CLASS Dad AS grandpa
proc init
dodefault()
endproc
ENDDEFINE

Then it all works. Weird, isn't it? Funny that it doesn't need any code in daughter.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform