Cusem Posted December 9, 2008 Posted December 9, 2008 I don't know exactly how autoit cumulates and handles AND and OR operators. If $c = $d AND $a + $b = 14 AND $a = 1 OR $b = 1 Then I'm not sure how the OR will be treated. For this to be TRUE, I want: $c = $d must be TRUE $a + $b = 14 must be TRUE $a = 1 OR $b=1 one of these two must be TRUE (So $a=1 is sufficient, $b doesn't have to be 1, but if $a <> 1, $b has to be 1) Will this work? Or do I have to create another IF statement within the first IF statement? Or is there another possibility like working with ()'s like If $c = $d AND $a + $b = 14 AND ($a = 1 OR $b = 1) Then Thanks!
weaponx Posted December 9, 2008 Posted December 9, 2008 Use parentheses just to be safe.http://www.autoitscript.com/autoit3/docs/i...g_operators.htm
Cusem Posted December 12, 2008 Author Posted December 12, 2008 Thanks! Didn't know if parentheses would work in an If statement but apparently they do. Thanks again!
Richard Robertson Posted December 12, 2008 Posted December 12, 2008 In order of operations, boolean operators usually come last. At that point they are evaluated from left to right. [usually]
Aceguy Posted December 12, 2008 Posted December 12, 2008 so $a=1 $b=1 $c=1 $d=1 If $a = 1 AND $a+$b=2 AND ($c = 1 OR $d = 1) Then MsgBox(0,"","Passed",0) Else MsgBox(0,"","Failed",0) EndIf is a good test for me [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
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