xzaz Posted December 19, 2007 Share Posted December 19, 2007 (edited) $i = 3 if $i == 1 OR 2 OR 7 Then MsgBox(0,"","Yhe!") Else msgBox(0,"","NO!") Endif Why do i get "Yhe!"? AND seems to work bether 0_o Edited December 19, 2007 by xzaz Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
Valuater Posted December 19, 2007 Share Posted December 19, 2007 This is a demo, hope it helps For $i = 1 To 8 If $i = 1 Or $i = 2 Or $i = 7 Then MsgBox(0, $i, "$i = 1 OR $i = 2 OR $i = 7", 2) ElseIf $i = 3 Then MsgBox(0, $i, "$i = 3", 2) Else ; not found MsgBox(0, $i, "Not Found", 2) EndIf Next 8) Link to comment Share on other sites More sharing options...
xzaz Posted December 19, 2007 Author Share Posted December 19, 2007 LOOOOOL So simple, dude sorry >.> Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
smashly Posted December 19, 2007 Share Posted December 19, 2007 (edited) Should be more like$i = 3 if $i == 1 Or $i == 2 Or $i == 7 Then MsgBox(0,"","Yhe!") Else msgBox(0,"","NO!") EndifBreak it down:if $i == 1 OR $i == 2 OR $i == 7 ThenSo $i can be any one of 1 or 2 or 7 to fire the "Yhe!" MsgBoxIf the statement was made with AND then the condition could never be met.Due to $i can not be a 1 and 2 and 7 all at the same time.So the ,"Yhe!" msgbox could never be reachedAnd would mean all conditions must be metOr would mean any one of the conditions can be met.I don't think I explained it very well , but I had a go at it..lolCheersEdit: damn I'm slow .. there was no posts when I started responding . Edited December 19, 2007 by smashly 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