Modify

Opened 12 years ago

Closed 12 years ago

#2621 closed Bug (No Bug)

Problem comparing strings

Reported by: diegomainster@… 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 guiness, 12 years ago

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

comment:2 by J-Paul Mesnage, 12 years ago

Resolution: No Bug
Status: newclosed

Please read Operators page, You will see that Not opetator has a higher precedence that =
so your expression is executed as (Not string1) = string2

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.