Complex IF Statement

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Complex IF Statement

Post by tommystery » Wed Jun 11, 2008 4:29 pm

Suppose that I wanted to make the following statements for one loop:

(A AND B) OR (C AND D) OR (E AND F)

Macroscheduler will not accept an if statement structured in that manner.

Would this be the correct way to structure it?

If>{(((A) AND (B)) OR (((C) AND (D)) OR ((E) AND (F))))}

Let me know if that's the correct syntax, thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jun 11, 2008 4:53 pm

Yes, but if A, B, C, D E and F are variables they need to be in % symbols. Also you probably need a comparison:

If{( ( (%A%="Something") AND (%B%="Something) ....

Since regular MacroScript doesn't have real booleans you're probably comparing strings. Put strings in quotes. Numbers on their own.

See the help file topic "Complex Expressions".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Post by tommystery » Wed Jun 11, 2008 5:18 pm

Thanks for the quick response Marcus. 8)

And I found the help file limited in terms of the examples given.

tommystery
Junior Coder
Posts: 26
Joined: Fri May 16, 2008 12:30 pm

Post by tommystery » Thu Jun 12, 2008 2:19 am

Could someone possibly take a look at this if statement and tell me where the errors lay?

IF>{(((%hour%=00) AND (%minutes%>=30)) OR (((%hour%>=01) AND (%hour%=12) AND (%hour%=21) AND (%hour%<23)) OR (((%hour%=23) AND (%minutes%=00))))))))}

Thanks

EDIT: Please disregard; I found the error, my variable is hours not hour. 8)

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