Venix Posted May 9, 2012 Share Posted May 9, 2012 (edited) My problem is i am trying to quickly code something for a ordering application that would ask a person what table they are on and if the table number entered is between 1 and 25 then it carries on as normal and if anything is outside of these boundaries then it will display an error. I figured this would be very simple to code with using 2 sets of operators in one line so i made a test code, unfortunately AutoIt doesn't like this for some reason could anyone post me a solution. Test Code$TableNumber = InputBox("Table Number", "Please Enter A Table Number From 1-25") If $TableNumber >=1 And <= 25 Then MsgBox(0, "Table", "Table Is Ok") Else MsgBox(0, "Table", "Table Is Bad") EndIfIf possible please give me an understanding of why this code wont work, i was almost positive it would. Edited May 9, 2012 by Venix Link to comment Share on other sites More sharing options...
James Posted May 9, 2012 Share Posted May 9, 2012 Almost $TableNumber = InputBox("Table Number", "Please Enter A Table Number From 1-25") If $TableNumber >=1 And $TableNumber <= 25 Then MsgBox(0, "Table", "Table Is Ok") Else MsgBox(0, "Table", "Table Is Bad") EndIf Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Venix Posted May 9, 2012 Author Share Posted May 9, 2012 Thanks i thought it would be something simple, its always the simple things. Link to comment Share on other sites More sharing options...
Spiff59 Posted May 10, 2012 Share Posted May 10, 2012 And another method... Not necessarily better, but to add some spice to your thread $TableNumber = InputBox("Table Number", "Please Enter A Table Number From 1-25") Switch $TableNumber Case 1 to 25 MsgBox(0, "Table", "Table Is Ok") Case Else MsgBox(0, "Table", "Table Is Bad") EndSwitch 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