Guest EES Posted December 31, 2003 Share Posted December 31, 2003 $vHealthCheck = ($vHealth / 25) If $vHealthCheck = 1 OR 2 OR 3 OR 4 Then MsgBox(0, "Congratz", "It works great") Else MsgBox(0, "Failed", "Your number is incorrect") EndIfThat's what I have so far, but it always comes back as the first message box (The correct one)I have used numbers like 20 and 5 and 125. Link to comment Share on other sites More sharing options...
scriptkitty Posted December 31, 2003 Share Posted December 31, 2003 (edited) If $vHealthCheck = 1 OR 2 OR 3 OR 4 Then $vHealthCheck = ($vHealth / 25) If $vHealthCheck = 1 OR $vHealthCheck =2 OR $vHealthCheck =3 OR $vHealthCheck =4 Then MsgBox(0, "Congratz", "It works great") Else MsgBox(0, "Failed", "Your number is incorrect") EndIfUse of Or sounds like your problem. if 1 then MsgBox(0, "Congratz", "It works great") endifactually a good spot for line continuation Shameless plug of Unofficial help file $vHealthCheck = ($vHealth / 25) If $vHealthCheck = 1 OR _ $vHealthCheck =2 OR _ $vHealthCheck =3 OR _ $vHealthCheck =4 Then MsgBox(0, "Congratz", "It works great") Else MsgBox(0, "Failed", "Your number is incorrect") EndIf Edited December 31, 2003 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Guest EES Posted December 31, 2003 Share Posted December 31, 2003 Alright, thanks, I'll use that for now. But if anyone can determine if OR is allowed, please let me know. Link to comment Share on other sites More sharing options...
Guest EES Posted December 31, 2003 Share Posted December 31, 2003 Sorry for the double post, but I can't click the edit button without getting logged out. But I found the answer!! The correct usage isIf $vHealthCheck = 1 OR $vHealthCheck = 2 OR $vHealthCheck = 3 OR $vHealthCheck = 4 Link to comment Share on other sites More sharing options...
Insolence Posted December 31, 2003 Share Posted December 31, 2003 $vHealthCheck = ($vHealth / 25) If $vHealthCheck = 1 OR _ $vHealthCheck =2 OR _ $vHealthCheck =3 OR _ $vHealthCheck =4 Then MsgBox(0, "Congratz", "It works great") Else MsgBox(0, "Failed", "Your number is incorrect") EndIf He gave you the correct answer there, lines contiued with the underscore, is the only difference. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. 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