If and AND issue

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
b0bst3r
Newbie
Posts: 3
Joined: Mon Dec 26, 2011 11:23 pm

If and AND issue

Post by b0bst3r » Mon Dec 26, 2011 11:27 pm

Hi

Code: Select all

Let>fleetcount=0
If>instance>=21
    Let>fleetcount=15
Endif
That works fine, a bit of background first I guess, instance is derived from user input:

Code: Select all

  Input>instance,Enter Instance ...
How do I do:

Code: Select all

If > instance > 10 and instance <15
Endif
I've tried all combinations of using {} and {( )} and it doesn't seem to work with or without %.

Thanks in advance

Urgh I can't post the third part forum keeps changing the code.
After last If and before Endif should be

Let>fleetcount=10

Endif

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

Post by JRL » Tue Dec 27, 2011 4:04 am

The first part may not error out but its not really working. greater than or equal and less than or equal both need to be within a complex expression format to work.

Check "Disable HTML in thei post" when posting to get most code to post properly.

Code: Select all

Input>instance,Enter Instance ...

Let>fleetcount=0
If>{%instance%>=21}
    Let>fleetcount=15
Endif

If>{(%instance%>10)and(%instance%<15)}
  Let>fleetcount=10
Endif

MDL>fleetcount

b0bst3r
Newbie
Posts: 3
Joined: Mon Dec 26, 2011 11:23 pm

Post by b0bst3r » Tue Dec 27, 2011 10:36 am

Thanks JRL worked a treat.

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