Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty middle layer class - runs eldest method
Message
From
03/04/1999 03:23:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
02/04/1999 19:42:22
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00204785
Message ID:
00204906
Views:
37
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform