Functions.ALenT 方法 (__ArrayBaseT) |
命名空间: XSharp.RT
1LOCAL aArray := {{1, 2}, {1, 2}, {1, 2}} 2? ALen(aArray) // 3 3? ALen(aArray[1]) // 2
1LOCAL aArray := {{1, 2}, {1, 2}, {1, 2}} 2LOCAL nRow, nColumn AS SHORTINT 3LOCAL nRowCount, nColumnCount AS SHORTINT 4nRowCount = ALen(aArray) 5FOR nRow := 1 UPTO nRowCount 6 nColumnCount = ALen(aArray[nRow]) 7 FOR nColumn := 1 UPTO nColumnCount 8 ? nRow, nColumn, aArray[nRow][nColumn] 9 NEXT 10NEXT
1FUNCTION Dimensions(aArray) 2 LOCAL aDims := {} 3 DO WHILE IsArray(aArray) 4 AADD(aDims, ALen(aArray)) 5 aArray := aArray[1] 6 ENDDO 7 RETURN (aDims)