This line of code does not run properly in if else endif statements due to the {((%SUB_CODE%"l")OR(%SUB_CODE%"p"))}
However if I run this code and change the functionality in the if else endif statements, it runs OK
If>{((%SUB_CODE%="l")OR(%SUB_CODE%="p"))}
Any ideas why?
Other Syntax Issues
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Don't you mean:
If>{((%SUB_CODE% "l") AND (%SUB_CODE% "p"))}
i.e. SUB_CODE must be anything other than I or P?
Mixing not equals and OR is a common mistake. OR means either one of the conditions can be true. If SUB_CODE is "p" then the first condition is true. While the second is not true the entire expression is true because each part is ORd. If SUB_CODE is "l" then the first expression is not true but the second IS true, so the entire If resolves true. Using AND ensures that ALL expressions must be true. Therefore it works if SUB_CODE is "l" or "p".
If>{((%SUB_CODE% "l") AND (%SUB_CODE% "p"))}
i.e. SUB_CODE must be anything other than I or P?
Mixing not equals and OR is a common mistake. OR means either one of the conditions can be true. If SUB_CODE is "p" then the first condition is true. While the second is not true the entire expression is true because each part is ORd. If SUB_CODE is "l" then the first expression is not true but the second IS true, so the entire If resolves true. Using AND ensures that ALL expressions must be true. Therefore it works if SUB_CODE is "l" or "p".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?