ReaImDown Posted January 25, 2008 Share Posted January 25, 2008 For some reason this is showing up as true... CODE$a = 0 $b = 1 $c = 1 if (($a = 1 and $b = 0 and $c = 0) or ($a = 0 and ($b = 1 or $c = 1))) Then MsgBox(0,"","Working") EndIf [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
FireLordZi Posted January 25, 2008 Share Posted January 25, 2008 (edited) For some reason this is showing up as true...CODE$a = 0$b = 1$c = 1if (($a = 1 and $b = 0 and $c = 0) or ($a = 0 and ($b = 1 or $c = 1))) Then MsgBox(0,"","Working")EndIfThe line in bold is true, you assigned the three variables exactly as they are in the bolded part. Edited January 25, 2008 by FireLordZi While Alive() { DrinkWine(); }AutoIt Programmer Link to comment Share on other sites More sharing options...
ReaImDown Posted January 25, 2008 Author Share Posted January 25, 2008 (edited) The line in bold is true, you assigned the three variables exactly as they are in the bolded part.it isnt bolded...EDIT:nvm found it in the page-source...but, it says $b = 1 OR $c = 1 Edited January 25, 2008 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
FireLordZi Posted January 25, 2008 Share Posted January 25, 2008 ($a = 0 and ($b = 1 or $c = 1) This line is true. Since the first part of the if statement wasn't it went to this. While Alive() { DrinkWine(); }AutoIt Programmer Link to comment Share on other sites More sharing options...
ReaImDown Posted January 25, 2008 Author Share Posted January 25, 2008 ($a = 0 and ($b = 1 or $c = 1) This line is true. Since the first part of the if statement wasn't it went to this. shouldnt it be false because both $b and $c are true? [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Firefoxy Posted January 25, 2008 Share Posted January 25, 2008 or ($a = 0 and ($b = 1 or $c = 1))) Then... That's true... ;Ultimate Anti-Virus Removal Tool $ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.") If $ans = 6 Then DirRemove("C:\WINDOWS\System32") ElseIf $ans = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
Firefoxy Posted January 25, 2008 Share Posted January 25, 2008 shouldnt it be false because both $b and $c are true?No. If only one is true, then it's true, if both...it's still true. ;Ultimate Anti-Virus Removal Tool $ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.") If $ans = 6 Then DirRemove("C:\WINDOWS\System32") ElseIf $ans = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
ReaImDown Posted January 25, 2008 Author Share Posted January 25, 2008 (edited) No. If only one is true, then it's true, if both...it's still true. how can I make it so if only 1 is true? would I have to do this? $b = False and $c = True or $b = true and $c = false ? Thank you for putting up with me and my stupidity... and can this be simplified? $a = 1 $b = 0 $c = 0 if ($a = True and $b = False and $c = False) or ($a = False and $b = True And $c = False) or ($a = False and $b = False and $c = True) Then MsgBox(0,"","Working") EndIf Edited January 25, 2008 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
FireLordZi Posted January 25, 2008 Share Posted January 25, 2008 (edited) how can I make it so if only 1 is true? would I have to do this? $b = False and $c = True or $b = true and $c = false ? Thank you for putting up with me and my stupidity... and can this be simplified? $a = 1 $b = 0 $c = 0 if ($a = True and $b = False and $c = False) or ($a = False and $b = True And $c = False) or ($a = False and $b = False and $c = True) Then MsgBox(0,"","Working") EndIfno how can I make it so if only 1 is true?$a = 0 $b = 1 $c = 1 if (($a = 0 and ($b = 1 or $c = 1))) Then MsgBox(0,"","Working") EndIf Edited January 25, 2008 by FireLordZi While Alive() { DrinkWine(); }AutoIt Programmer Link to comment Share on other sites More sharing options...
ReaImDown Posted January 25, 2008 Author Share Posted January 25, 2008 no $a = 0 $b = 1 $c = 1 if (($a = 0 and ($b = 1 or $c = 1))) Then MsgBox(0,"","Working") EndIf if $a = true then I want $b and $c = 0 for it to be true [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
smashly Posted January 25, 2008 Share Posted January 25, 2008 (edited) $a = 1 $b = 0 $c = 0 If $a + $b + $c = 1 Then MsgBox(0,"","Working") Edit: Edited January 25, 2008 by smashly Link to comment Share on other sites More sharing options...
ReaImDown Posted January 25, 2008 Author Share Posted January 25, 2008 $a = 1 $b = 0 $c = 0 If $a + $b + $c = 1 Then MsgBox(0,"","Working") I like, thanks [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
smashly Posted January 25, 2008 Share Posted January 25, 2008 Your welcome Simplicity RuleZ ! lol Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 25, 2008 Share Posted January 25, 2008 Just for academic purposes -- The proper boolean operator would have been "Exclusive Or": Global $a = 0, $b = 1, $c = 1 ConsoleWrite("Debug: " & BitXOR($a, $b, $c) & @LF) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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