AutoHotkey Community

It is currently May 27th, 2012, 6:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: February 9th, 2012, 12:23 am 
Code:
   IfInString, A_LoopField, (4 or 5 or 2);;;
      counton += 1


i would like to find 4 or 5 or 2
could you help me?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2012, 12:31 am 
Offline

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
Code:
If (instr(A_LoopField, 4) || instr(A_LoopField, 5) || instr(A_LoopField, 2))
   counton += 1

or
Code:
if A_loopfield in 4,5,2
  counton+=1

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2012, 12:39 am 
Offline

Joined: August 25th, 2011, 8:41 pm
Posts: 460
Another method other than tidbit's:

Code:
If A_LoopField contains 4,5,2
     counton ++ ; sames as counton += 1


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 9th, 2012, 1:00 am 
HIHIHO wrote:
Code:
   IfInString, A_LoopField, (4 or 5 or 2);;;
      counton += 1


i would like to find 4 or 5 or 2
could you help me?

[/code]
Code:

listA=
(
1=apple
2=orange
3=apple
4=grape
5=strawberry
6=mango
}

counton := 0
Loop, parse, listA, `n, `r
{
   If A_LoopField contains apple,mango
      counton += 1
      NUM := NUM . A_LoopField





I Would find what number contain apple,mango

could you help me?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2012, 7:40 pm 
Offline

Joined: August 25th, 2011, 8:41 pm
Posts: 460
listA=
(
1=apple
2=orange
3=apple
4=grape
5=strawberry
6=mango
)

counton := 0
Loop, parse, listA, `n, `r
(
If A_LoopField contains apple,mango
counton += 1
NUM := NUM . A_LoopField
MsgBox %A_Index% ; A_Index is a built-in variable that contains the number of the current iteration of the loop
)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: migz99, sjc1000 and 75 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