I am confused by the behavior of complex operators in a While loop.
The behavior of = is not obvious.
According to Online Help, these are valid.
http://www.mjtnet.com/OnlineHelp/index. ... rators.htm
Examples:
//Works as expected, loops through 2 times and then moves on
Let>X=3
Let>Y=1
While>X>Y
Let>Y=Y+1
EndWhile
//Skips over the loop even though X is initially less than Y
Let>X=3
Let>Y=1
While>X>=Y
Let>Y=Y+1
EndWhile
//Runs forever, even though Y gets incremented to greater than X
Let>X=3
Let>Y=1
While>YY=Y+1
EndWhile
Can someone explain this to a newb?
Confusion over complex operators: <= >=
Moderators: JRL, Dorian (MJT support)
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hmmmn. Must be a bug. >= and <= should be supported, but it doesn't look like they are working properly in While. I've added this to the work list.
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?
The same help file mentions:
"...in Macro Scheduler all complex functions should be contained within curly braces ("{" and "}"). "
So X>=Y
should be something like {%X%>=%Y%}
Furthermore:
"Complex expressions are supported in Macro Scheduler's IF statements and LET statement, and since version 9.0 can now also be included within all other commands and function calls in the place of regular variables."
However, it has been mentioned that while does not seem to accept complex expressions, see http://www.mjtnet.com/forum/viewtopic.php?p=28133
So please add the whole while statement to the list of work to be done.
"...in Macro Scheduler all complex functions should be contained within curly braces ("{" and "}"). "
So X>=Y
should be something like {%X%>=%Y%}
Furthermore:
"Complex expressions are supported in Macro Scheduler's IF statements and LET statement, and since version 9.0 can now also be included within all other commands and function calls in the place of regular variables."
However, it has been mentioned that while does not seem to accept complex expressions, see http://www.mjtnet.com/forum/viewtopic.php?p=28133
So please add the whole while statement to the list of work to be done.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
We'll get it sorted.
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?