我所說的是多維陣列的概念大致就像排隊集合一樣
只是當你在寫成陣列與法時是用他的INDEX表示
如Dim Ar(0 to 10,0 to 20,0 to 10,0 to 30)
這樣就宣告了一個4維陣列
只訂出這陣列中第一個元素就寫成
Ar(0,0,0,0)
最後一個元素就是Ar(10,20,10,30)
第一維有11個元素
第二維有21個元素
第三維有11個元素
第四維有11個元素
Sub nn()
Dim Ar(11, 21, 11, 31)
For i = 0 To 10
For j = 0 To 20
For x = 0 To 10
For y = 0 To 30
Ar(i, j, x, y) = i + j + x + y: Next: Next: Next: Next
For i = 0 To 10
For j = 0 To 20
For x = 0 To 10
For y = 0 To 30
MsgBox "Ar(" & i & "," & j & "," & x & "," & y & ")=" & i & "+" & j & "+" & x & "+" & y & "=" & Ar(i, j, x, y): Next: Next: Next: Next