DEFINE CLASS theFirst as Custom oSecond = Null myVal = Null PROCEDURE Init This.oSecond = NEWOBJECT("theSecond") This.myVal = this.oSecond.myVal ENDPROC ENDDEFINE DEFINE CLASS theSecond as Custom oThird = Null myVal = Null PROCEDURE Init This.oThird = NEWOBJECT("theThird") This.myVal = this.oThird.myVal ENDPROC ENDDEFINE DEFINE CLASS theThird as Custom myVal = "1234" ENDDEFINE
>DEFINE CLASS theFirst as Custom >oSecond=NEWOBJECT("theSecond") >myVal=this.oSecond.myVal >ENDDEFINE > >DEFINE CLASS theSecond as Custom >oThird=NEWOBJECT("theThird") >myVal=this.oThird.myVal >ENDDEFINE > >DEFINE CLASS theThird as Custom >myVal="1234" >ENDDEFINE >>
>oFirst=NEWOBJECT("theFirst","theClass.prg") >? oFirst.myVal (prints "1234") >? TYPE("oFirst.oSecond") (prints "O") >? TYPE("oFirst.oSecond.oThird") (prints "U") >oSecondAndAHalf=oFirst.oSecond >? oSecondAndAHalf.myVal (prints "1234") >? TYPE("oSecondAndAHalf.oThird") (prints "O") >? TYPE("oSecondAndAHalf.oThird.myVal") (prints "U") >>
>? oFirst.oSecond.myVal >>