AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Arrays...

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
neondragon1
Guest





PostPosted: Sat Feb 21, 2009 8:33 pm    Post subject: Arrays... Reply with quote

Hi AHK'ers Very Happy

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 Smile
Back to top
Jex



Joined: 01 Aug 2008
Posts: 101

PostPosted: Sat Feb 21, 2009 10:14 pm    Post subject: Reply with quote

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:
Code:
Item_%MyVar%

And in a loop:
Code:
Loop
{
Item_%A_Index% ...
}

_________________
Woot.

Please read forum etiquette
Back to top
View user's profile Send private message
Frankie



Joined: 02 Nov 2008
Posts: 2850

PostPosted: Sun Feb 22, 2009 2:22 am    Post subject: Reply with quote

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)

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group