Modify

Opened 9 years ago

Closed 9 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 Changed 9 years ago by doudou

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 Changed 9 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.