IF with AND

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

IF with AND

Post by mpsinfo » Sat Feb 03, 2024 5:05 pm

I don't understand why the IF function with AND doesn't work. Skips the lines after the IF and goes directly after the ENDIF

Code: Select all

Let>cnr=1
Let>dir=-1
The various versions are all ignored

Code: Select all

If>cnr=1 AND dir=-1

Code: Select all

If>(cnr=1) AND (dir=-1)
This even gives an "Unknown Identifier CNR" error

Code: Select all

If>{(cnr=1) AND (dir=-1)}
Where am I doing wrong ?

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: IF with AND

Post by Grovkillen » Sat Feb 03, 2024 6:12 pm

Code: Select all

If>{(%cnr% = 1) AND (%dir% = -1)}
And if you are comparing other types:

Code: Select all

If>{(%cnr% = %first%) OR (%cnr% = %another%)}

Code: Select all

If>{(%cnr% = "one") AND (%dir% = "minus one")}
Let>ME=%Script%

Running: 15.0.27
version history

mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

Re: IF with AND

Post by mpsinfo » Sun Feb 04, 2024 9:37 am

OK.. thanks..

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts