CrewXp Posted October 18, 2005 Share Posted October 18, 2005 Should be an easy question, how can I run two Then statements on one line? If $a=1 Then $b=2, $c=3 etc etc I need them on one line to organize, thx Link to comment Share on other sites More sharing options...
Valuater Posted October 18, 2005 Share Posted October 18, 2005 Should be an easy question, how can I run two Then statements on one line?If $a=1 Then $b=2, $c=3 etc etcI need them on one line to organize, thxIf $a = 1 Then $b=2 And $c=38) Link to comment Share on other sites More sharing options...
LxP Posted October 18, 2005 Share Posted October 18, 2005 (edited) Hmm... I'm afraid that won't work as expected... I'm pretty sure that your only option is as follows:If $A = 1 Then $B = 2 $C = 3 ; etc. ; etc. EndIfEdit: Although I can clearly see where Valuater's coming from (and it's perfectly valid English), if $A were equal to 1 then I imagine that this code:If $A = 1 Then $B = 2 And $C = 3would set $B to False. It would initally seem strange to hear this but AutoIt would treat everything as Booleans because of the And. 2 is non-zero which evaluates to the Boolean True, while ($C = 3) would evaluate to False. True And False would simplify to False and $C would not be touched by this command. Edited October 18, 2005 by LxP Link to comment Share on other sites More sharing options...
Valuater Posted October 18, 2005 Share Posted October 18, 2005 Hmm... I'm afraid that won't work as expected... I'm pretty sure that your only option is as follows:If $A = 1 Then $B = 2 $C = 3 ; etc. ; etc. EndIfEdit: Although I can clearly see where Valuater's coming from (and it's perfectly valid English), if $A were equal to 1 then I imagine that this code:If $A = 1 Then $B = 2 And $C = 3would set $B to False. It would initally seem strange to hear this but AutoIt would treat everything as Booleans because of the And. 2 is non-zero which evaluates to the Boolean True, while ($C = 3) would evaluate to False. True And False would simplify to False and $C would not be touched by this command.news to me... but LxP is correctDim $a = 1, $b, $c If $a = 1 Then $b=2 And $c=3 MsgBox(0,"Test", $a & @CRLF & $b & @CRLF & $c ) If $a = 1 Then $b=2 $c=3 EndIf MsgBox(0,"Test", $a & @CRLF & $b & @CRLF & $c )thx LxP8) 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