Copying a Object and Retaining its values?

BlitzMax Forums/BlitzMax Programming/Copying a Object and Retaining its values?

Type Laser
	Field name:String
	Field iX:Int
	Field iY:Float
	Field iZ:Double
	
	Method Update()
	  	Print "NAME:"+name
	  	Print "iX: "+iX
		 Print "iY: "+iY
		Print "iZ: "+iZ
	End Method
	
	Function copylaser:Laser(source:laser,newname:String)
		temp:laser = New laser
			temp.name = newname
			temp.iX = Source.iX
			temp.iY = source.iY
			temp.iZ = source.iZ
			
		Return temp
	
	End Function

End Type


death:laser = New laser
death.name = "Death Laser"
death.iX = 100
death.iY = 222.333
death.iZ = 666

crazylaser:laser = death.copylaser(death,"KrazyLaser")

death.Update
Print
crazylaser.Update