Hopefully this will help you on multidimensional arrays.
Dim myArray(5)
RemStart
Think of single dimensional arrays as one row across a spreadsheet.
The single dimensional array, myArray(x), would be setup like this (if it already had some random data in it):
(x goes from left to right)
0 1 2 3 4 5
[31] [51] [62] [23] [43] [87]
myArray(1) would equal 51
myArray(4) would equal 43
etc.
RemEnd
Dim myMultiArray(5, 3)
RemStart
Think of multidimensional arrays as the rows AND columns of a spreadsheet.
The multidimensional array, myMultiArray(x, y), would be setup like this (if it already had some random data in it):
(x goes from left to right)
(y goes from top to bottom)
0 1 2 3 4
0 [43] [54] [12] [10] [77]
1 [74] [47] [89] [34] [78]
2 [65] [45] [34] [67] [33]
3 [76] [87] [34] [14] [89]
myArray(1,2) would equal 45
myArray(4,1) would equal 78
myArray(3,0) would equal 10
etc.
RemEnd
Dim myArrayTest(3,2)
ArrayCounter = 0
for y = 0 to 2
for x = 0 to 3
myArrayTest(x,y) = ArrayCounter
inc ArrayCounter, 1
next x
next y
RemStart
The above code puts data into the array
The data in your new array would look like this:
0 1 2 3
0 [0] [1] [2] [3]
1 [4] [5] [6] [7]
2 [8] [9] [10] [11]
myArrayTest(2,1) would equal 6
myArrayTest(3,1) would equal 7
myArrayTest(1,1) + myArrayTest(3,2) would equal 16
etc.
RemEnd
Hopefully, that makes multidimensional arrays a little easier to understand!
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.