If I have an interface method which returns an instance of another object, how do I declare things such that I can call them in sequence?
For example:
Code: Select all
DeclareModule SomeObject
Interface BoxObject
getWidth()
getHeight()
EndInterface
Interface Public
;/ [Error] A structure can't be used with ProcedureReturn.
;getBox.BoxObject()
getBox()
EndInterface
Declare new()
EndDeclareModule
Module SomeObject
Procedure new()
EndProcedure
EndModule
Interface SomeObject Extends SomeObject::Public
EndInterface
obj.SomeObject=SomeObject::new()
;/ [Error] Garbage at the end of the line.
Debug obj\getBox()\getWidth()
Why can't I do this?
Code: Select all
;/ Allowed
obj.SomeObject=*instance
;/ Not allowed?
Procedure.SomeObject ProcA()
ProcedureReturn *instance
EndProcedure