3.5.0-beta.4 Unknown variable error with M99
-
Below is a skeletal macro (/sys/M3000). When called with
M3000
(no parameters) it throws an error.Note that it reports the error at line 10 as opposed to line7
When called with abort instead of M99 , it completes without error.
What is the expected behavior of M99 ?
; macro /sys/M3000.g ; check if B parameter sent if !exists(param.B) M99 ;abort "M3000 -- No parameter was passed." set var.Bparam = param.B if var.Bparam = "Init" echo "Init" elif var.Bparam = "Clear" echo "Clear" elif var.Bparam = "Del" echo "Del" else echo "Ordinary"
I stumbled on this trying to use M99 like a 'return' statement (several in the same macro). e.g.
if <do something> M99 if <do something> M99 if <do something> M99 <do something>
I ended up refactoring (as per the example) as an if - elif -elif .... structure to eliminate the use of M99 because the behavior was unclear.
-
@stuartofmt What board is this running on?
-
@gloomyandy said in 3.5.0-beta.4 Unknown variable error with M99:
@stuartofmt What board is this running on?
SBC
Pi - Duet3D Buster Image. Did a
sudo apt update && sudo apt dist-upgrade
today -
@stuartofmt this works for me in standalone mode, so I think is has to do with M99 processing in DSF. I'll ask @chrishamm to take a look.
-
@stuartofmt Thanks for reporting this, I could reproduce and fix this.