trancexx Posted November 20, 2008 Share Posted November 20, 2008 (edited) I'm getting different return types depending on what I'm running, beta (3.2.13.8 - yeah I know) or stable (3.2.12.1) version. This code demonstrates the difference: ConsoleWrite((((1 > 5) & 1) = 1) & @CRLF) Problem is that I can't find the change to be documented. Is it me or is it not? Edited November 20, 2008 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 20, 2008 Share Posted November 20, 2008 (edited) I'm getting different return types depending on what I'm running, beta (3.2.13.8 - yeah I know) or stable (3.2.12.1) version. This code demonstrates the difference: ConsoleWrite((((1 > 5) & 1) = 1) & @CRLF) Problem is that I can't find the change to be documented. Is it me or is it not? The behavior was fixed in 3.2.13.8:- Fixed #589: Some comparison operators did not return a boolean value. In 3.2.12.1, (1 > 5) = 0 (not a boolean variant) Because of that, ((1 > 5) & 1) = 01 (string variant) When you do "01" = 1, the string is run through Number() and (1 = 1) = True. After the fix in 3.2.13.8, (1 > 5) = False (Boolean variant, converted to string on display) Because of that, ((1 > 5) & 1) = False1 (string variant) When you do "False1" = 1, the string is run through Number() and returns 0 because there are non-numeric characters, so (0 = 1) = False. Edited November 20, 2008 by PsaltyDS 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...
trancexx Posted November 20, 2008 Author Share Posted November 20, 2008 The behavior was fixed in 3.2.13.8:In 3.2.12.1, (1 > 5) = 0 (not a boolean variant)Because of that, ((1 > 5) & 1) = 01 (string variant)When you do "01" = 1, the string is run through Number() and (1 = 1) = True.After the fix in 3.2.13.8, (1 > 5) = False (Boolean variant, converted to string on display)Because of that, ((1 > 5) & 1) = False1 (string variant)When you do "False1" = 1, the string is run through Number() and returns 0 because there are non-numeric characters, so (0 = 1) = False. Ok, thanks for clarifying that.Does this mean that Is... functions (IsInt(), IsNum()...) will be modified to return True/False in future (near one)? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 20, 2008 Share Posted November 20, 2008 Ok, thanks for clarifying that.Does this mean that Is... functions (IsInt(), IsNum()...) will be modified to return True/False in future (near one)?As far as I know the functions that are explicitly described as returning 1 or 0 will continue to return an integer type. 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