Calculations inside IF statement

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Fred
Newbie
Posts: 18
Joined: Sat Aug 05, 2017 4:44 pm

Calculations inside IF statement

Post by Fred » Tue Sep 05, 2017 10:38 pm

Some extremely simple idea seems not to work, or I dont understand the proper syntax here.
Imagine we have two simple programs. The first one see the statement as true, what is really wrong (0+0 is not > 0). The second one see the statement as false, what is true. Where is my problem? We are not able to have calculations inside if? But it seems some of them works ...

Let>a=0
Let>b=0
If>%a%+%b%>0
Message>OK
Wait>2
Endif



Let>a=0
Let>b=0
Let>c=%a%+%b%
If>c>0
Message>OK
Wait>2
Endif

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

Re: Calculations inside IF statement

Post by Marcus Tettmar » Wed Sep 06, 2017 2:03 pm

The syntax you want is:

If>{%a%+%b%>0}
...
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Fred
Newbie
Posts: 18
Joined: Sat Aug 05, 2017 4:44 pm

Re: Calculations inside IF statement

Post by Fred » Wed Sep 06, 2017 9:17 pm

Marcus Tettmar wrote:The syntax you want is:

If>{%a%+%b%>0}
...
Endif
Thank you, tried If>{%a%+%b%}>0 and If>(%a%+%b%)>0 with no luck. Now will now the problem was syntax.

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