LOCAL loImposter, loRealObject loImposter = CREATEOBJECT("Imposter") loRealObject = CREATEOBJECT("RealObject") loImposter.PoseAs(loRealObject) ?loImposter.Name ?loImposter.Class ?loImposter.HelloWorld() RETURN DEFINE CLASS Imposter AS CUSTOM PROCEDURE Self RETURN THIS ENDPROC PROCEDURE PoseAs LPARAMETERS toClient *-- If you use an nFlags value of 1, the value returned by a *-- method call to the event is not that of the event, *-- but rather that of the last delegate invoked. BINDEVENT(THIS, "self", toClient, "self", 1) ENDPROC PROCEDURE THIS_ACCESS LPARAMETERS tcPEMName LOCAL loHandler IF tcPEMName == "self" OR tcPEMName == "poseas" loHandler = THIS ELSE loHandler = THIS.Self() ENDIF RETURN loHandler ENDPROC ENDDEFINE DEFINE CLASS RealObject AS CUSTOM PROCEDURE Self RETURN THIS ENDPROC PROCEDURE HelloWorld RETURN "Hello World!" ENDPROC ENDDEFINE