Sagar
Sagar

Reputation: 3245

Retrieving all values from an array in AutoHotkey script

I have created an array as xArray:=[2, 3, 4]

I need to use these values one by one in a loop.

I have tried using a counter variable, but it didn't work.

There's even a predefined "A_Index" variable in ahk scripts. Can someone elaborate on that? It might be the solution.

Upvotes: 3

Views: 5666

Answers (1)

alpha bravo
alpha bravo

Reputation: 7948

xArray:=[2, 3, 4] 
for key, val in xArray
    MsgBox % val

Upvotes: 4

Related Questions