alan lim 0 Posted April 9, 2004 I have read through the help file and understand that there are only two operation, ( OR and AND )If $var = 5 AND $var2 > 6 Then If $var = 5 OR $var2 > 6 Then I want to use 'ANY operator'. Example if my value has 1,3,5,7. I want to use If <expression> Then statement. Is there anyway to use ANY operator. If my input is 5 then it will go to next line. Instead of input must be 1,3,5,7. Thankyou Share this post Link to post Share on other sites
jpm 93 Posted April 9, 2004 I have read through the help file and understand that there are only two operation, ( OR and AND )If $var = 5 AND $var2 > 6 Then If $var = 5 OR $var2 > 6 Then I want to use 'ANY operator'. Example if my value has 1,3,5,7. I want to use If <expression> Then statement. Is there anyway to use ANY operator. If my input is 5 then it will go to next line. Instead of input must be 1,3,5,7. ThankyouThere is no ANY operator in AutoIt3, so you need to code it yourself one checking at a time.Or you can use StringInStr("1!3!5!7!",string($n) & "!"). This will return true if $n =1 3 5 or 7 Share this post Link to post Share on other sites
ezzetabi 3 Posted April 9, 2004 Why not If $n = 1 or $n = 3 or $n = 5 or $n = 7 Then MsgBox(0,"","GREAT") ? Share this post Link to post Share on other sites
Gene 0 Posted April 9, 2004 Why notIf $n = 1 or $n = 3 or $n = 5 or $n = 7 Then MsgBox(0,"","GREAT")?If you code either solutions given to you as a User Defined Function, aka UDF, then you can call it ANY(value, choicelist), and use it in any code you write. If you haven't already read about UDFs in the Help file, do so, they aren't difficult.Gene [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... Share this post Link to post Share on other sites
alan lim 0 Posted April 10, 2004 I like to thank you peoples have gave me those advise. Thankyou very much. Share this post Link to post Share on other sites