I create a "Deep Clone" of mine:
This works in much the same way as the technique above, except it makes it somewhat simpler to make a copy of composite objects (objects that contain other objects), providing they also have a deepClone method (which you could have enforced with an Interface).
Type TVector Field xcomponent:Double, ycomponent:Double Method deepClone:TVector() Local myVector:TVector = New TVector myVector.xcomponent = xcomponent myVector.ycomponent = ycomponent Return myVector End Method End Typethen you just invoke it as if you where creating a new object:
myVectorAClone = myVectorA.deepClone()Idealy such behaviour should be determined by an Interface, but BlitzMax sadly doesn't have those.
This works in much the same way as the technique above, except it makes it somewhat simpler to make a copy of composite objects (objects that contain other objects), providing they also have a deepClone method (which you could have enforced with an Interface).