Conventions for: IF>a and b / IF>a or b

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Warren
Pro Scripter
Posts: 83
Joined: Sun Oct 08, 2017 11:57 pm

Conventions for: IF>a and b / IF>a or b

Post by Warren » Thu Oct 26, 2017 7:27 pm

I may be just looking in the wrong sections of documentation, or missing the right term to lookup, but I'm looking for ways to essentially say:

IF>a and b

and

If>a or b

I can find verbose ways to do this via nested conditionals, etc, but wanted to check to see if I'm missing a simpler convention.

thx

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Conventions for: IF>a and b / IF>a or b

Post by JRL » Thu Oct 26, 2017 8:46 pm

An example of what you're actually trying to do would be more helpful for me. But looking at your posted sample I'm guessing you'll have to use nested if> functions that are using complex expressions. You can find examples in help for If>.

Warren
Pro Scripter
Posts: 83
Joined: Sun Oct 08, 2017 11:57 pm

Re: Conventions for: IF>a and b / IF>a or b

Post by Warren » Thu Oct 26, 2017 9:38 pm

Simplest example without defining the negative (false) case:

AND:

Code: Select all

IF>x=TRUE
   IF>y=TRUE
      Let>XandYbothTrue=TRUE
   ENDIF
ENDIF


OR:

Code: Select all

IF>x=TRUE
   Let>XorYisTrue=TRUE
ENDIF

IF>y=TRUE
   Let>XorYisTrue=TRUE
ENDIF

Just checking to see if there is some sort of predefined conditional conjunction I've missed, or some other way of handling this that is widely adopted.

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Conventions for: IF>a and b / IF>a or b

Post by JRL » Thu Oct 26, 2017 9:51 pm

Code: Select all

Let>x=TRUE
Let>Y=FALSE

IF>{(%x%="TRUE")and(%y%="TRUE")}
  Let>XandYbothTrue=TRUE
ENDIF



IF>{(%x%="TRUE")or(%y%="TRUE")}
  Let>XorYisTrue=TRUE
ENDIF

Warren
Pro Scripter
Posts: 83
Joined: Sun Oct 08, 2017 11:57 pm

Re: Conventions for: IF>a and b / IF>a or b

Post by Warren » Thu Oct 26, 2017 10:47 pm

Thx. I've got these more complicated cases I'm trying to work out where a given subset of 6 total items may be true, and that determines an outcome.

I'll be able to work it out now that I've got the logical syntax.

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