Modify

Opened 16 years ago

Closed 16 years ago

#691 closed Bug (No Bug)

Not equal <> condition with OR gives wrong result

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.1 Severity: None
Keywords: Cc:

Description

Not equal <> condition with OR gives wrong result.

Example 1 give wrong result while example 2 gives correct result.

;example 1 (not working properly)
$temp=7
If $temp <> 1 OR $temp <> 7 Then

MsgBox(0, "MTM", "weekday")

Else

MsgBox(0, "MTM", "weekend")

EndIf

;example 2 (working properly)
$temp=7
If $temp = 1 OR $temp = 7 Then

MsgBox(0, "MTM", "weekend")

Else

MsgBox(0, "MTM", "weekday")

EndIf

Attachments (0)

Change History (1)

comment:1 Changed 16 years ago by Valik

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

I suggest you look again. If $temp is equal to 7 then $temp is not equal to 1 thus the first condition in your first example is true therefore the entire statement is true. You need to be using the AND operator in the first example, not OR.

No bug.

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.