SamuelKerschbaumer Posted January 25, 2008 Share Posted January 25, 2008 Hi.The comparison operator = is not reflexive:ConsoleWrite(Default = False)ConsoleWrite(False = Default)produces the output FalseTrue for me (AutoIT 3.2.10.0).Is this the desired behavior?There is some remark in the documentation about Default: "This keyword should not be used in computation expressions". But actually I am not sure whether False = Default is a computational expression. If it is, why does the example for default show this idiom, if it should not be used?Regards,Samuel Link to comment Share on other sites More sharing options...
danielkza Posted January 25, 2008 Share Posted January 25, 2008 The comparision operator is == ,and = is and asignment operator. Assignment operators are never reflexive,since you are copying data from right to the left,changing the order will change the result as expected. The Default keyword must only be used in simple comparisions,and it can never be added,subtracted,modified,used as an variable,etc. Link to comment Share on other sites More sharing options...
SamuelKerschbaumer Posted January 25, 2008 Author Share Posted January 25, 2008 I have to apologize, I meant "symmetric", not "reflexive" previous post.The comparision operator is == ,and = is and asignment operator.Assignment operators are never reflexive,since you are copying data from right to the left,changing the order will change the result as expected.The Default keyword must only be used in simple comparisions,and it can never be added,subtracted,modified,used as an variable,etc.No, the documentation says that both operators are comparison operators. The only difference lies in the case sensitivity when used with strings.Strangely Default == False does produce the right result (False).Apparently a bug, or what do you think? Link to comment Share on other sites More sharing options...
Bowmore Posted January 25, 2008 Share Posted January 25, 2008 I have to apologize, I meant "symmetric", not "reflexive" previous post. No, the documentation says that both operators are comparison operators. The only difference lies in the case sensitivity when used with strings. Strangely Default == False does produce the right result (False). Apparently a bug, or what do you think? This is not a bug. The behaviour you have observed is due to your misuse of the Default keyword Debug Keyword value use in function call. $var = Default Parameters None. Remarks This keyword should not be used in computation expression. AutoIt will not detect such situation because it's too much performance penalty. This demonstrated that = when used as comparison operator works correctly $a = 1 $b = 0 ConsoleWrite($a = $B) ConsoleWrite($b = $a) "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
therks Posted January 25, 2008 Share Posted January 25, 2008 The comparision operator is == ,and = is and asignment operator. Uh.. not in AutoIt. From the help file: = Assignment. e.g. $var = 5 (assigns the number 5 to $var) ... = Tests if two values are equal (case insensitive if used with strings). e.g. If $var= 5 Then (true if $var equals 5) == Tests if two values are equal (case sensitive if used with strings)= is both assignment AND comparison: $x = 2 $y = 3 ConsoleWrite(($x = $y) & @LF) ConsoleWrite($x & @LF) ConsoleWrite($y & @LF)oÝ÷ ØÚ-{MúÆ+,¶)eÙ§íz»ayø«²×(«Ê' My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
SamuelKerschbaumer Posted January 29, 2008 Author Share Posted January 29, 2008 This is not a bug. The behaviour you have observed is due to your misuse of the Default keywordHmmm, the "misuse" is given as an example just below the in the helppage that you have cited... 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