Array Sizing

BlitzMax Forums/BlitzMax Beginners Area/Array Sizing

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks for the help everyone. I finally understood the concept thanks to PowerPC's excellent example. Here is the final code incase anyone else needs to size a 3 dimensional array of types.
Type Tile
	Field txt$
End Type

Global Map:Tile[][][]

ResizeArray(5, 5, 2)
Map[4][4][0] = New Tile; Map[4][4][1] = New Tile
Map[4][4][0].txt$ = "Hello"
Map[4][4][1].txt$ = "Hello again"

PrintArraySize()
Print Map[4][4][0].txt$
Print Map[4][4][1].txt$
WaitKey()

Function ResizeArray(width, height, f)
	Map = Map[..width]

	For i = 0 Until width
		Map[i] = Map[i][..height]
	Next

	For i = 0 Until width
		For b = 0 Until height
			Map[i][b] = Map[i][b][..f]
		Next
	Next
End Function

Function PrintArraySize()
	Print Map.length
	Print Map[0].length
	Print Map[0][0].length

End Function