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.