FUNCTION GetAge() RETURN this.oTime.PointOfTime - this.dBirthDate ENDFUNCThe dodefault() call passes the methods call onto whatever code you might be inheriting from. In this particular case it's not needed because you were derived directly from a VFP BaseClass. But if Person was derived from some class say "Entity" and it has code in its Init() method it wouldn't be executed without the dodefault(). It's a good habit to get into to typically call dodefault() before or after your subclass' code. Sometimes it's necessary to structure the code:
... code that needs executing before the ParentClass code dodefault() ... code that needs executing after the ParentClass codeYou also have to consider that even though the ParentClass might not have code in a method right now, it may in the future so your subclass needs to accomodate it.
>oPerson = createobject("Person") >oTime = createobject("zaTime") >oPerson.Init(oTime) >oPerson.GetAge() > >*** the Function init is then as follow: >function Init(toTime) >this.oTime = toTime >return dodefault() > >