AutoHotkey Community

It is currently May 26th, 2012, 2:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: January 23rd, 2009, 1:55 am 
Offline

Joined: June 16th, 2007, 3:23 am
Posts: 280
Can we search among variable value? Ex: I have 20 variable containing numbers, can I search for one that contain the number 11.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2009, 3:00 am 
Offline

Joined: September 28th, 2007, 3:56 am
Posts: 279
Location: New York
You could loop through them like this...

Code:
variablesList = variable1|thisVariable|thatVariable|variable298765

Loop, Parse, variablesList, |
{
  if A_LoopField contains 11
    do whatever it is you want to do with the variables
}


Let me know it that helps.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2009, 3:31 am 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
ribbs2521 wrote:
You could loop through them like this...

Code:
variablesList = variable1|thisVariable|thatVariable|variable298765

Loop, Parse, variablesList, |
{
  if A_LoopField contains 11
    do whatever it is you want to do with the variables
}


Let me know it that helps.


if you use contains. the Number 1111 will be treated as 11 so will 1134 and 2311 and 2113...

I changed contains to =

Code:
variablesList = variable1|thisVariable|thatVariable|variable298765

Loop, Parse, variablesList, |
{
  if A_LoopField = 11
    do whatever it is you want to do with the variables
}

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto, poserpro, Yahoo [Bot] and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group