laffo16 Posted October 6, 2006 Share Posted October 6, 2006 dim $cash, $leavetablechips $cash = InputBox("Question", "Enter table with (X) cash", 10, "", 240, 124) if @error = 1 Then Exit EndIf $leavetablechips = InputBox("Question", "Leave table if chips are less then (X)", 7, "", 240, 124) if @error = 1 Then Exit EndIf if $leavetablechips > $cash Then MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.") MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit") Exit EndIf i dont understand why i'm getting the msgbox pop up error when i run this. If 7 > 10 then msgsbox & exit. for some reason i dont understand i'm getting the msgbox & exit. however when if i use this code: dim $cash, $leavetablechips $cash = 10 $leavetablechips = 7 if $leavetablechips > $cash Then MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.") MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit") Exit EndIf it works fine. where am i going wrong? thank you Link to comment Share on other sites More sharing options...
Gigglestick Posted October 6, 2006 Share Posted October 6, 2006 Side note... WTF is a "newbi"? Multiple Newbies? My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
Developers Jos Posted October 6, 2006 Developers Share Posted October 6, 2006 (edited) dim $cash, $leavetablechips $cash = 10 $leavetablechips = 7 if $leavetablechips > $cash Then MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.") MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit") Exit EndIf it works fine. where am i going wrong? thank you YOu are doing an Alphanumeric test which compares characters ...not values: dim $cash, $leavetablechips $cash = "10" $leavetablechips = "7" if $leavetablechips > $cash Then MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.") MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit") Exit EndIf Use Number() to convert the typed characters to a real value Edited October 6, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
cppman Posted October 6, 2006 Share Posted October 6, 2006 (edited) Side note... WTF is a "newbi"? Multiple Newbies?hahah.. "newbi".. *cough* anyways.. Just like Jdeb said, but i took to long to reply Global $cash, $leavetablechips $cash = Int(InputBox("Question", "Enter table with (X) cash", 10)) if @error = 1 Then Exit EndIf $leavetablechips = Int(InputBox("Question", "Leave table if chips are less then (X)", 7)) if @error = 1 Then Exit EndIf if $leavetablechips > $cash Then MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.") MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit") Exit EndIf Edited October 6, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
laffo16 Posted October 6, 2006 Author Share Posted October 6, 2006 thank u 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