Author: Michael Babcock, mbabcock@kepro.org
Posted: 1999-09-14 09:44:14 Link
Makes sense to me, because without the dodefault(), your child proc (Show) is
overriding the inherited code.
HTH,
--Mike
>>> "computing@dial.pipex.com" 09/14/99 09:37am >>>
####################################################
The following message part was sent with the unknown
character set: "WINDOWS-1252"
####################################################
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
********************************
Michael Babcock
KePRO, Inc.
Tel: 717-564-8288
Fax: 717-564-4188
Internet Address: mbabcock@kepro.org
Home Page: http://www.kepro.org
********************************
Author: Andy_Davies/ITUnit/MCC@notes.manchester.gov.uk
Posted: 1999-09-14 09:56:50 Link
"Is this correct, it does make sense?"
Seems OK to me too, but I'm not very OOPy.
BTW if you do DODEFAULT() you then get :
1) a ? message
2) a wait window
both generated by your SHOW() - thus exhibiting a simple polymorphism in
the SHOW method.