VFP6 & OOP - newbie question -Reply

Author: Michael Babcock, mbabcock@kepro.org

Posted: 1999-09-14 at 09:44:14

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

********************************

©1999 Michael Babcock, mbabcock@kepro.org