Modify ↓
Opened 12 years ago
Closed 12 years ago
#2621 closed Bug (No Bug)
Problem comparing strings
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.10.2 | Severity: | None |
| Keywords: | Cc: |
Description
Hello, in version 3.3.10.2, I have to put the strings to be compared between parentheses, I think it's a bug, because in version 3.3.8.1, I do not have to do that. This problem only occurs when using the "Not".
$str = 'TEXT' If Not StringLeft($str, 2) = 'M_' Then MsgBox(0, 'without brackets', 'OK') Else MsgBox(16, 'without brackets', 'Error') EndIf If Not (StringLeft($str, 2) = 'M_') Then ; if I put in brackets, compare properly MsgBox(0, 'with brackets', 'OK') Else MsgBox(16, 'with brackets', 'Error') EndIf
Attachments (0)
Change History (2)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Please read Operators page, You will see that Not opetator has a higher precedence that =
so your expression is executed as (Not string1) = string2
Note:
See TracTickets
for help on using tickets.

This has always been the case when using Not. No Bug.