Code: Select all
myClass = { x = 0, y = 0 }
Function myClass:New(parameters)
Local NewObj = CopyTable(self) ; <--- here is where I've made the mistake in the previous post
TB.Set(NewObj, parameters, False)
Return(NewObj)
EndFunction
Local myObject = myClass:New()
; Now I can derivate objects from the one we have just created
; but I want more properties
myObject.z = 1
myObject.k = 0.5
; New object based on myObject
myDerivedObject = myObject:New({ z = 10 })