Resizing 2d Arrays

BlitzMax Forums/BlitzMax Beginners Area/Resizing 2d Arrays

Ant(Posted 2006) [#1]
Hi, I know you can resize 1D arrays but is it possible to resize 2d arrays? If so can someone post an example?
Thanks


klepto2(Posted 2006) [#2]
No, you can't the only possible way would be the use of Arrays in arrays.
Here a sample:

Local Test:Int[][]
Test = Test[..200]

For Local I = 0 To 199
   Test[I] = Test[I][..200]
Next


For Local x = 0 To 199
   For Local y  = 0 To 199
      Test[x][y] = Rand(0,200)
   Next
Next


'Resizing

Test = Test[..20]

For  I = 0 To 19
   Test[I] = Test[I][..20]
Next

For X = 0 To 19
   For  Y = 0 To 19
      Print "Array : " + x + " : " + y + " = " +Test[x][y]
   Next
Next 



Ant(Posted 2006) [#3]
ok thanks for the info


DREAM(Posted 2008) [#4]
oops