I thought I knew OOP, oops.

BlitzMax Forums/BlitzMax Programming/I thought I knew OOP, oops.

test1 is an instance on testtype

test2 is just a pointer to test1.

in order to do a 'deep' copy you will simply create a new instance and copyt the attributes from test1 to test 2


Strict
Type testType
	Field a:Int	=0
	
	Method update()
		a:+1
	EndMethod
EndType

Local Original: testType = New testType
Local myCopy: testType = New testType

For Local b = 1 To 5
	Original.update
Next
myCopy.a = original.a

Print Original.a
Print myCopy.a