| View previous topic :: View next topic |
| Author |
Message |
neondragon1 Guest
|
Posted: Sat Feb 21, 2009 8:33 pm Post subject: Arrays... |
|
|
Hi AHK'ers
I was just wondering, if it was possible to make static arrays in AHK? I have some experiance in visual basic, where i remember the syntax is something like:
| Code: | dim var(10)
var() = array(item1,item2,item3..item10) |
Is that possible in AHK.
/reply fast please  |
|
| Back to top |
|
 |
Jex
Joined: 01 Aug 2008 Posts: 101
|
Posted: Sat Feb 21, 2009 10:14 pm Post subject: |
|
|
There are no arrays in AHK.
But, there are ways to simulate arrays.
For example, consider the following variables:
| Code: | Item_0
Item_1
Item_2
Item_3
Item_4
|
In AHK, they can be referred to like an array. Ex:
And in a loop:
| Code: | Loop
{
Item_%A_Index% ...
}
|
_________________ Woot.
Please read forum etiquette |
|
| Back to top |
|
 |
Frankie
Joined: 02 Nov 2008 Posts: 2850
|
Posted: Sun Feb 22, 2009 2:22 am Post subject: |
|
|
Or you can use Laszlo's List manipulation functions. You can put the functions in a seprate file and include it. So this example asumes that the functions are in a file callsed List Functions.ahk | Code: | #Include, List Functions.ahk
list = apple, orange, banana
Msgbox % ListItem(2, list) |
_________________ aboutscript ⍟ apps ⍟ scripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run |
|
| Back to top |
|
 |
|