Author: Bourque, Chad, Chad@teche.net
Posted: 1999-09-14 at 09:52:33
Stuart,
This is correct. You are overriding xPoly.Show() with xPolyChild.Show(),
not appending to it. The DoDefault() makes an explicit call to the Parent
method of the same name. This gives you the ability to add code before
and/or after the parent code or, as you have demonstrated, override the
parent code. Sample of before and after:
Proc Show
Wait Window 'This is Child Before Parent'
DoDefault()
Wait Window 'This is Child After Parent'
EndProc
HTH
Chad Bourque
U.S. Bankruptcy Court - 11th Circuit
Alabama - Northern District - Southern Division
Chad@teche.net
----- Original Message -----
From: AMS Computing <computing@dial.pipex.com>
To: Multiple recipients of ProFox <profox@leafe.com>
Sent: Tuesday, September 14, 1999 8:22 AM
Subject: VFP6 & OOP - newbie question
: Okay so I am thick, but does the Polymorphism donkey upset Inheritance
cart?
:
: Using an example from a book to explain Poly...
:
: *****
: DEFINE CLASS xPoly AS custom
: PROC show
: WAIT WINDOW 'This is the root class'
: ENDPROC
: ENDDEFINE
:
: DEFINE CLASS xPolyChild AS xPoly
: PROC show
: ? 'This is the child of xPoly'
: ENDPROC
: ENDDEFINE
:
: SET PROC TO ...
: oTest = CREATEOBJECT('xPolyChild')
: oTest.Show()
: ****
:
: Only shows the child not the parent, unless I included DODEFAULT() in
: xPolyChild.Show
: Is this correct, it does make sense?
:
: regards
:
: Stuart Hurley
: ams_ltd@dial.pipex.com
:
:
: