ArrayGetT Function (Array OfT, DWord) |
Namespace: XSharp.RT
1FUNCTION Start() 2 LOCAL aStates[3] 3 LOCAL i AS SHORTINT 4 ArrayPut(aStates, 1, "Montana") 5 ArrayPut(aStates, 2, "Wyoming") 6 ArrayPut(aStates, 3, "Idaho") 7 FOR i := 1 UPTO ALen(aStates) 8 QOut(ArrayGet(aStates, i)) 9 NEXT 10 // Below we print the same array in two different 11 // ways from the above: 12 // Functional equivalent of FOR...NEXT 13 AEval(aStates, {|Element| QOut(Element)}) 14 // Using [] to get an array element 15 FOR i := 1 UPTO ALen(aStates) 16 QOut(aStates[i]) 17 NEXT