Modify

Opened 16 years ago

Closed 16 years ago

#1600 closed Bug (No Bug)

please check "=" Operator bug

Reported by: ssmmhh@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: = Cc:

Description

please check "=" Operator bug

  1. ConsoleWrite (0 = "x") ; -> True
  2. ConsoleWrite (0 == "x") ; -> False
  3. ConsoleWrite (1 = "x") ; -> False
  4. ConsoleWrite (1== "x") ; -> False

why "1." result is true, is this bug?

i found this issue in Array.au3 (_ArraySearch)
case compare 0 vs string

971 : If $avArray[$i] = $vValue Then Return $i
997 : If $avArray[$i][$j] = $vValue Then Return $i

Attachments (0)

Change History (2)

comment:1 by doudou, 16 years ago

I think, this was discussed many times in the forums and this is "by design":

ConsoleWrite((0 = "x") & @lf)

is equivalent to:

ConsoleWrite((0 = Number("x")) & @lf)

Since Number("x") returns 0 the statement is True. The following produces "expected" result on the other hand:

ConsoleWrite(("x" = 0) & @lf)

as it is the same as:

ConsoleWrite(("x" = String(0)) & @lf)

comment:2 by Valik, 16 years ago

Resolution: No Bug
Status: newclosed

What do I have to do to make it clear to you people that if you are asking a question on the issue tracker you're in the wrong place? I mean, I only have it in the big giant red box. I suggest you try reading it next time because your failures in creating this ticket are numerous.

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.