by cncdrive » Sun Feb 04, 2018 9:30 pm
Hi Terry,
I don't know how the OP is updating the var, but it is not too important now, the important is that the var was updated.
For the tests I made now I wrote a simple macroloop which reads the checkbox and sets the # var to 0 or to 1 depending on if the checkbox was ticked in or not.
The problem now is that when L is 0, is defined with a var e.g. L#1 when #1 == 0 then the interpreter sees that the value of the L is 0 and so it does not even interpret the M98 code which is the problem now.
So, when the #1 and so the L was 0 when the g-code was loaded then the code was not interpreted, so the user changes the #1 var to other than 0 will still not enter the subroutine, because the M98 line was not interpreted on loading.
How I will change this is that the interpreter will interpret also when the L parameter is 0, but when it is 0 it will not enter the sub and this will be handled in runtime in the executer.
So, the overal working will be the same as now after the fix, but the L parameter when it is defined with a #var then it can be set to 0 and from 0 to other value also on the fly which is not working properly now.