Hi folks,
how can I copy an multidimensional array? I just found "slices", but that just works on 1d-arrays...
how can I copy an multidimensional array? I just found "slices", but that just works on 1d-arrays...
' create and fill source array Local array:Int[10,10] Local i:Int,n:Int,c:Int For i=0 Until 10 For n=0 Until 10 c:+1 array[i,n] = c Next Next ' create new array and copy contents of the source array into it Local copy:Int[10,10] MemCopy(copy,array,SizeOf(array)) ' prove contents are correct Local l$ For i=0 Until 10 For n=0 Until 10 l$:+copy[i,n]+" " Next l$:+"~n" Next Print l