Jump to content

Recommended Posts

We all know about "If something = something then" but what about "If something ≠ something then"? Didn't find any help on any does not equal command in the autoit help file, does something like this exist? If not is there any way around this, maybe using <> instead of ≠ which I know doesnt' work :whistle:?

Edited by ravenfyre
Link to post
Share on other sites

Instead of using !=, use <>.  You could also do something like (untested):

$x=6

If Not $x = 5 Then

  MsgBox(0,"Test","$x isn't equal to 5.")

Else

  MsgBox(0,"Test","$x is equal to 5.")

EndIf

$x=6

If Not($x = 5) Then
  MsgBox(0,"Test","$x isn't equal to 5.")
Else
  MsgBox(0,"Test","$x is equal to 5.")
EndIf

Need to have the parenthesis around the condition being evaluated for NOT to work properly.

Link to post
Share on other sites

Hmmm.  It seems to have worked fine for me in the past without the parens.  Thanks for letting me know.

I think Jon updated the order of operations in one beta.

The precedence of operations, from highest to lowest:

    ( )

    NOT

    ^

    * /

    + -

    &

    < > <= >= = <> ==

    AND OR

Thus, Not $x = $y evaluates as (Not $x) = $y
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...