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" ENDDEFINESo I instantiate theFirst and access members:
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")...you get the idea.
? oFirst.oSecond.myValI get an "Unknown member OSECOND" error.