Hi Frank, I know that MSG doesn't expand parameters. When I implemented "DEBUG," which works just like MSG but expands parameters, I could have made MSG work the same way. I made a conscious decision to NOT do that.
If I had done that, there was a possibility of breaking existing programs in the sense that they would not give the same messages as before. My general philosophy has been that changes to the interpreter should not change the behavior of existing valid programs. A workaround is to use DEBUG instead of MSG. A reasonable alternative would be to modify the interpreter to add an .ini variable: EXPAND_PARAMETERS_IN_MSG. If that is set to a non-zero value, parameters would be expanded. Ken Frank Tkalcevic wrote: > I need to check and report errors in a Gcode program. I want to validate > the parameters passed into my o-word subroutine. At the moment I am doing > this... > > > O10 if [ #<initialCutDepth> LE 0 ] > (MSG, Invalid initialCutDepth=#<initialCutDepth>) > M2 > O10 endif > > > but it only detects the error at run time. > > I can also put in a bogus statement, such as a G76 without arguments... > > > O10 if [ #<initialCutDepth> LE 0 ] > (MSG, Invalid initialCutDepth=#<initialCutDepth>) > G76 > O10 endif > > > And at load time I get "All axes missing with motion code", although it > points to the wrong line. > > Is there a better way? > > > Oh, and I just noticed that MSG doesn't expand parameters. That's annoying. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Emc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users > -- Kenneth Lerman Mark Kenny Products Company, LLC 55 Main Street Newtown, CT 06470 888-ISO-SEVO 203-426-7166 ------------------------------------------------------------------------------ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
