eskermeko Posted April 12, 2007 Share Posted April 12, 2007 (edited) Hi Everyone I have this: Case $res = "05333520" $ans = "5" Case $res = "05333620" $ans = "5" Case $res = "05333610" $ans = "5" Case $res = "05333610" $ans = "5" Case $res = "05333640" $ans = "5" How can you do a case between numbers so I dont have to make so many possibilities ie. Case $res = Between 05200000 & 05400000 $ans = "5" Thanks for help Edited April 12, 2007 by eskermeko Link to comment Share on other sites More sharing options...
Zedna Posted April 12, 2007 Share Posted April 12, 2007 Use Switch...Case...EndSwitch there is "Case <value> [To <value>]"Switch $res Case 05200000 To 05400000 ; statement1 ; ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
eskermeko Posted April 12, 2007 Author Share Posted April 12, 2007 (edited) Thanks thats perfect. Edited April 12, 2007 by eskermeko Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 12, 2007 Share Posted April 12, 2007 Thanks thats perfect. Zedna gave you the best answer, I just wanted to point out that you can use boolean logic to get that comparison in other situations too: If $res >= 05200000 And $res <= 05400000 Then MsgBox(0, "", "It's between!") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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