Code: Select all
MyClass.SubClass("Test", "Second", 3)
Class MyClass {
Class SubClass extends MyClass.Functor {
Call(Params*) {
msgbox % this.ParseObject(Params)
}
ParseObject(Params) {
for Index, Param in Params
ParamText .= "`n" Param
return SubStr(ParamText, 2)
}
}
Class Functor {
__Call(NewEnum, Param*) {
(new this).Call(Param*)
}
}
}
This implies that a new instance of MyClass.SubClass is created for each 'method' call, so inside the SubClass you can do whatever you want with the instance without worrying about messing it up for later calls.
The code can be thought of as a more complicated version of this:
Code: Select all
MyClass.SubClass("Test", "Second", 3)
Class MyClass {
SubClass(Param*) {
for Index, Param in Params
ParamText .= "`n" Param
msgbox % SubStr(ParamText, 2)
}
}