An Array of: arrays-of-arrays

BlitzMax Forums/BlitzMax Programming/An Array of: arrays-of-arrays

If anyone could look through this example program and see what I want to do, that would be helpful.

Each Area is a 2D-array of 2D-arrays. I want to put theses Areas into an array. That would mean an array of arrays of arrays. But blitz doesn't seem to allow this, and I don't know what to do.

Graphics 800,600

Const amount=2'will change as I add a lot more.

'area works like areaID[width,height][,]
Global Area0[,][,]
Global Area1[,][,]

'it will soon get to like Area33[,][,] so I would like another array:
'like this Area[][,][,]
'Global Area[amount][,][,] 'this line does not compile!



'all areas[x,y] will point to one of these preexisting 3x3 arrays.

Local dr2[,]=areaset(..
0,0,0,..
0,1,1,..
0,1,1)

Local row1[,]=areaset(..
1,1,1,..
0,0,0,..
0,0,0)

Local row2[,]=areaset(..
0,0,0,..
1,1,1,..
0,0,0)
'etc. etc. there will be about 30 of theses 3x3 arrays


'the amount of area id's is constant but the width and height of each one differs.
'no maximum width or height.
Global AreaWidth[amount]
Global AreaHeight[amount]

'area with id=0 will be of size 2x2
areawidth[0]=2
areaheight[0]=2
area0=New Int[,][2,2]
area0[0,0]=dr2
area0[1,0]=dr2
area0[0,1]=row1
area0[1,1]=row1

areawidth[1]=1
areaheight[1]=1
area1=New Int[,][1,1]
area1[0,0]=row1


'draw each one
Local areanow[,][,] 'pointer
For id=0 To amount-1

	'this IF shouldn't have to be here...
	If id=0 Then
		areanow=area0
	ElseIf id=1 Then
		areanow=area1
	'elseif id=...
	EndIf
	
	Cls
	DrawText "area "+id,500,0
	For y=0 To areaheight[id]-1
		For x=0 To areawidth[id]-1
			drawx=x*35
			drawy=y*35
			SetColor 111,111,111
			DrawRect drawx,drawy,30,30
			SetColor 222,222,222
			For y2=0 To 2
				For x2=0 To 2
					If areanow[x,y][x2,y2]=1 Then
						DrawRect drawx+x2*10,drawy+y2*10,9,9
					EndIf
				Next
			Next
		Next
	Next
	Flip
	WaitKey
Next


'Ititialize a 3x3 array
Function AreaSet:Int[,](v00,v10,v20, v01,v11,v21, v02,v12,v22)
	Local a:Int[3,3]
	
	a[0,0]=v00
	a[1,0]=v10
	a[2,0]=v20

	a[0,1]=v01
	a[1,1]=v11
	a[2,1]=v21

	a[0,2]=v02
	a[1,2]=v12
	a[2,2]=v22
	
	Return a
EndFunction


OMG I just realized that this works:

Global Area[,][,][amount]

Allright, you just have to declare it backwards...
but you access it like this:

area[id][x,y]=some3x3array

Is this backwards to anyone else?