alan lim Posted April 9, 2004 Share 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 Link to comment Share on other sites More sharing options...
jpm Posted April 9, 2004 Share 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 Link to comment Share on other sites More sharing options...
ezzetabi Posted April 9, 2004 Share Posted April 9, 2004 Why not If $n = 1 or $n = 3 or $n = 5 or $n = 7 Then MsgBox(0,"","GREAT") ? Link to comment Share on other sites More sharing options...
Gene Posted April 9, 2004 Share 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... Link to comment Share on other sites More sharing options...
alan lim Posted April 10, 2004 Author Share Posted April 10, 2004 I like to thank you peoples have gave me those advise. Thankyou very much. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now