回复 1# blue_dvd
你想把数组放在另一个数组里面做为一个元素(象C语言里那样)?若是这个意思,au3里没有直接的方法干这事的,因为au3并没有给变量单独的地址空间。但可以间接地通过一个变量来得到嵌入数组的入口,这样做虽然可以,但会使得code非常地不可读性,特别在传递这个数组时,非常容易搞错。
Local $arr[3]
Local $a1[3] = [2, "a1-1","a1-2"]
Local $a2[3] = [2, "a2-1","a2-2"]
$arr[1] = $a1
$arr[2] = $a2
$arr[0] = 2
Local $dumy
For $i = 1 to $arr[0]
$dumy = $arr[$i]
If IsArray($dumy) Then
For $j = 1 to $dumy[0]
ConsoleWrite("$i:=" & $i & ", $dumy[" & $j & "]:=" & $dumy[$j] & @LF)
Next
Else
ConsoleWrite("!>Oops!, What happened? Expected an array!" & @LF)
EndIf
Next
若不是上面意思,那就直接定义个三维数组就可以了,有什么问题呢?
Global $aArray[3][4][2] = [[["000", "001"], ["010", "011"], ["020", "021"], ["030", "031"]], _
[["100", "101"], ["110", "111"], ["120", "121"], ["130", "131"]], _
[["200", "201"], ["210", "211"], ["220", "221"], ["230", "231"]]]
ConsoleWrite($aArray[2][1][0] & @CRLF)
|