Jump to content
Sign in to follow this  
vickerps

How Do You Use Or, Not, And

Recommended Posts

If $NoReceiptPrnt < 5 OR $NoReceiptPrnt > 10 Then...

If 1 = 1 AND 2 = 2 Then... (Always true)

If Not(1=2) Then (Always true)

Share this post


Link to post
Share on other sites

Thanks guys

I'm now stuck again

Example1:

IF $name = NOT 'paul' THEN

msgbox -------

IF $name = NOT 'paul' OR $name = NOT 'ste' THEN

msgbox -------

Doesn't seem to work properly is the "NOT" in the right place

Share this post


Link to post
Share on other sites

AND, OR, and NOT are used with entire conditions, not values (well not like that anyway :whistle: ). So, use these like this:

If $i > 15 AND $j < 15 Then

The conditions $i>15 and $j<15 must both be true for the entire thing to be considered true.

If $i > 15 OR $j > 15 Then

The conditions $i>15 and $j>15 must either be true for the entire thing to be considered true. If both are true, it is still considered true.

If NOT $i>15 THEN

Reverse the value of the condition. You might want to use

If $i <= 15 THEN

instead.


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

CODE 

If NOT $i>15 THEN

Reverse the value of the condition. You might want to use

David, I think because of the operator precedence stuff, that is resolved to (NOT $i)>15 when what you really meant was Not($i > 15).

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...