Relational Operators

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Giles.Buist
Newbie
Posts: 15
Joined: Wed Feb 15, 2006 2:25 pm
Location: London

Relational Operators

Post by Giles.Buist » Tue Feb 21, 2006 10:31 am

Hi,

I can't get the code below to work:


Let>P_Item=35

Random>100,R2

If>R2C:\Rec.txt,Res,Step2
Macro>C:\ItemSearch.scp
Endif



The If statement is never entered, even if R2 is less then or equal to 35. What do I need to do differently?

All help much appreicated

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

Post by Marcus Tettmar » Tue Feb 21, 2006 10:41 am

You are using a complex expression, so you must use the following syntax:

If>{%R2%<=%P_Item%}
Last edited by Marcus Tettmar on Tue Feb 21, 2006 11:06 am, edited 2 times in total.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Giles.Buist
Newbie
Posts: 15
Joined: Wed Feb 15, 2006 2:25 pm
Location: London

Post by Giles.Buist » Tue Feb 21, 2006 11:04 am

Do I also need %'s around the variables R2 and P_Item?

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

Post by Marcus Tettmar » Tue Feb 21, 2006 11:07 am

Sorry, yes, my mistake, the variables will need % symbols around them. I have edited my previous reply accordingly.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Giles.Buist
Newbie
Posts: 15
Joined: Wed Feb 15, 2006 2:25 pm
Location: London

Post by Giles.Buist » Tue Feb 21, 2006 11:08 am

Thanks for the help.

robertb
Newbie
Posts: 2
Joined: Fri Feb 10, 2006 7:29 pm
Location: The U S of A

Post by robertb » Wed Feb 22, 2006 4:23 pm

Can you advise what constitutes a complex if statement?
Is comparing one variable to another variable a complex statement, but one value to another value a simple if statement?
Thanks,
Robert

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

Post by Marcus Tettmar » Wed Feb 22, 2006 4:28 pm

See "complex expressions" in the help file. Complex expressions are set between curly braces { .. }. Simple statements have only one operator.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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