how to copy an array?

BlitzMax Forums/BlitzMax Beginners Area/how to copy an array?

Firstdeathmaker(Posted 2008) [#1]
Hi folks,

how can I copy an multidimensional array? I just found "slices", but that just works on 1d-arrays...


grable(Posted 2008) [#2]
If its an array of one of the basic types (int,float, etc) you should be able to use MemCopy.


ImaginaryHuman(Posted 2008) [#3]
You can't just use a single memcopy.

For each dimension in the array you have separate memory spaces. The first dimension is all in one memory space. But then each array pointed to by the first array has its own memory space.

You have to write a loop to do the copy in parts.


REDi(Posted 2008) [#4]
grable is correct, just use memcopy...