how to make an instance equal to another

BlitzMax Forums/BlitzMax Programming/how to make an instance equal to another

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I create an Assign method on my objects.


Type TMyType
   Field A%
   Field B%

   Method Assign(P_source: TMyType)
      A% = P_source.A%
      B% = P_source.B%
   End Method

End Type

local aType: TMyType
local bType: TMyType

aType = New TMyType
bType = New TMyType

aType.A% = 100
aType.B% = 200

bType.Assign(aType)

'
' bType now has all the same values as aType but is a
' different Instance.
'