Copying a Object and Retaining its values?

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

If you want to do a shallow copy (e.g., copy all pointers and values instead cloning all associated objects), just create a new object of the same type and do this:

MemCopy( Varptr original.firstField, Varptr other.firstField, theSizeOfTheType ) ' I don't trust SizeOf due to it being rather context sensitive