Code: Select all
; loop through items in first dimension
for item in mySafeArray[0] { ; results in error - "Invalid number of parameters"
msgbox(item)
}
Code: Select all
; loop through items in first dimension
for item in mySafeArray[0] { ; results in error - "Invalid number of parameters"
msgbox(item)
}
Code: Select all
#Requires AutoHotkey v2.0-beta.1
mySafeArray := ComObjArray(VT_VARIANT:=12, 1, 3)
mySafeArray[0, 0] := "Auto"
mySafeArray[0, 1] := "Hot"
mySafeArray[0, 2] := "key"
; loop through items in first dimension
for item in (
(secondDimIndex := 0) => ( ; zerobased indices
(&key) => ( ; enumerator func
(secondDimIndex <= mySafeArray.MaxIndex(2)) ; has items left?
? (
key := mySafeArray[0, secondDimIndex++], ; get current item, advance index
true ; continue enumerating remaining items
)
: (
false ; index out of bounds, no items left, stop enumerating
)
)
)
)() ; dont forget to call it
{
msgbox(item)
}
Users browsing this forum: Descolada, WilliamLeGod and 72 guests