Multidimensional arrays

Previous topic - Next topic

Elemee

I'm new to GLB and trying to convert a game I wrote in another Basic dialect which uses a 6 dimensional array as a primary data structure.  It appears there is a 4 dimension limit in GL Basic.  I thought of using Types to address this and was wondering if multidimensional arrays can be handled as variables in a Type, and what the limits are regarding associating chains of variables with Types.  I'm a complete novice so if someone can point me in the right direction to learn about this (other than just trial and error) I'd appreciate it.     

Kitty Hello

Yes.
Type A
Stuff []
Endtype
Tyoe B
evenmorestuff [] as A
endtype
...

sf-in-sf

Multidimensional arrays? You could switch to C inline code to use them as such. Otherwise, you can use a monodimensional array, and compute which cell/address you want to access. It's the same... remember that all the memory is linear, and accessed like that in a linear way, the data addresses.
Example: GLOBAL v%[] // confusing, I know.   DIM v%[10][20][30][40]
"v[w][X][y][z]" is nothing more than v[40*30*20*w + 40*30*X + 40*y + z]     (from memory lane, please check it.)
This way the number of dimensions in unlimited -just the total RAM size is.
On the day the atom is a cube I will start believing in the square pixel.