Code: Select all
OOP = {}
Function OOP:NewInstance()
o = {}
o.variable = 1
Return(o)
EndFunction
Function OOP:FuncToBeMadeLater()
EndFunction
Function OOP:NewInstance_Type1()
o = OOP:NewInstance()
o:FuncToBeMadeLater = Function() stuff EndFunction
Return(o)
EndFunction
testOOP = OOP:NewInstance_Type1()
But now the problem is that I want to use the SELF system, which means I need to use : when declaring that. However, when I do that at O:FuncToBeMadeLater = Function() stuff EndFunction, it gives me an error.
If I use O.FunctoBeMadeLater instead, it works fine, except I dont have the self then.
Is there a way for me to do this in such a way that I can get the SELF there?