Code: Select all
$name := ["adf", "zcxv", "agf", "zxcv", "adsf", "qtq", "dfsg", "cbvn", "fgjh", "ytre"] ; the hardcoded array. It shouldn't be a problem to parse AU3 arrays adding its content to a variable on the fly instead.
Random, i, 1, $name.MaxIndex() ; creating a random number of iterations for testing
Loop % i ; looping that random number of iterations
MsgBox % "We'll check the content of " . i . " vars.`nThis is the " A_Index . ". one: " . $name[A_Index] ; getting all array elements based on the number of iterations
SoundBeep
MsgBox % This is the content of the 5th array element: $name[5] ; getting a single array element by its number/position within the array
Not tested.
There are definitely more sophisticated methods available. But the following one (that lies within my abilities) should do the trick ...
Code: Select all
Global $name
$name := ["adf", "zcxv", "agf", "zxcv", "adsf", "qtq", "dfsg", "cbvn", "fgjh", "ytre"]
func(8) ; the no of the element from where you want to go until the end of the array. Here the 8th one: "cbvn", ...
func(Element) {
i := $name.MaxIndex()-(Element-1)
Loop % i {
MsgBox % $name[Element]
Element++
}
}
Hope that helps.