Redim array

BlitzMax Forums/BlitzMax Beginners Area/Redim array

MattVonFat(Posted 2005) [#1]
How would i do this?

Thanks
Matt


skn3(Posted 2005) [#2]
myarray = myarray[..newsize]



MattVonFat(Posted 2005) [#3]
Thanks. But now i'm getting an error which says incorrect number of array dimensions...but thats not right as i'm using 3 throughout.




teamonkey(Posted 2005) [#4]
tiles=[xSize,ySize,3]

Should be
tiles = New Int[xSize,ySize,3]



Michael Reitzenstein(Posted 2005) [#5]
Nah, it should be:

tiles = New Int[ xSize + 1, ySize + 1, 3 + 1 ]

Since he's accessing the xSize-th element.


MattVonFat(Posted 2005) [#6]
Ok this is a worrying error...unable to convert from Int Array to Int Array? Surely it shouldnt need to convert it?


teamonkey(Posted 2005) [#7]
How did you define it? It should be something like
Global tiles:Int[,,]
for a 3-dimensional array.

Michael's right about the sizes, by the way.