redimming a 2D object array

BlitzMax Forums/BlitzMax Beginners Area/redimming a 2D object array

Joss Adley(Posted 2008) [#1]
can anyone help me out with the syntax for this?



thx in advance :)


CASO(Posted 2008) [#2]
Look in the help for slices...
This flexibility allows you to use slices to resize or copy arrays. For example:

Local a[200] 'initialize a[] to 200 elements
a=a[50..150] 'extract middle 100 elements of a[]
a=a[..50] 'extract first 50 elements of a[]
a=a[25..] 'extract elements starting from index 25 of a[]
a=a[..] 'copy all elements of a[]
a=a[..200] 'resize a[] to 200 elements




Perturbatio(Posted 2008) [#3]
you can't slice multi-dimensional arrays. But you can use a jagged array instead.


tonyg(Posted 2008) [#4]
You can't do it for a 2D array. You need to copy to a new, larger array.