multidimensional arrays
Posted: Mon Nov 10, 2008 7:52 pm
Okay, I think I'm getting the hang of it. It seems so simple but I don't think the human brain was made to understand it.
Here's what I think it works:
When I say dimension those 4 column(=dimension) values aren't going to
travel through time! It's just like excel, and you give all boxes a name, example:
......col1 col2 col3
[0]..[4].[5.5].[22] //all this is
......[2].[1.7].[21] //part of
......[7].[8.1].[44] //row 0, it
......[1].[3.4].[16] //just got branched
So:
ocal.array[0] = "test"
local.array[0][0] = 4
local.array[0][1] = 2
local.array[0][2] = 7
local.array[0][3] = 1
local.array[0][0][0] = 5.5
local.array[0][0][1] = 1.7
local.array[0][0][2] = 8.1
local.array[0][0][3] = 3.4
local.array[0][0][0][0] = 22
local.array[0][0][0][1] = 21
local.array[0][0][0][2] = 44
local.array[0][0][0][3] = 16
I hope I got it. (I need to use .... dots because forums always remove tabs and double spaces etc...)
If so, then I guess stuff like local.array[0][2][3][1] is pretty complicated stuff!!!
EDIT:
the above is unlogical, don't pay attention to this
Here's what I think it works:
When I say dimension those 4 column(=dimension) values aren't going to
travel through time! It's just like excel, and you give all boxes a name, example:
......col1 col2 col3
[0]..[4].[5.5].[22] //all this is
......[2].[1.7].[21] //part of
......[7].[8.1].[44] //row 0, it
......[1].[3.4].[16] //just got branched
So:
ocal.array[0] = "test"
local.array[0][0] = 4
local.array[0][1] = 2
local.array[0][2] = 7
local.array[0][3] = 1
local.array[0][0][0] = 5.5
local.array[0][0][1] = 1.7
local.array[0][0][2] = 8.1
local.array[0][0][3] = 3.4
local.array[0][0][0][0] = 22
local.array[0][0][0][1] = 21
local.array[0][0][0][2] = 44
local.array[0][0][0][3] = 16
I hope I got it. (I need to use .... dots because forums always remove tabs and double spaces etc...)
If so, then I guess stuff like local.array[0][2][3][1] is pretty complicated stuff!!!
EDIT: