Add a new error number significantly higher that any existing error number to the file rs274ngc_return.hh -- Give it the symbol: NCE_VARIABLE.|
Add a new error number to the file rs274ngc_return.hh -- Give it the symbol: NCE_VARIABLE.|
This has been implemented and works. Note that Axis will require a change to handle this the same way the normal interpreter does. Right now, Axis prints the dummy message associated with NCE_VARIABLE.|
A change that permits the call to a (o-word) subroutine prior to its definition in a file is an example. It would be desirable to give the error: "Unable to find oNNNN called from line MMMM in file abc.ngc", for instance. That is not possible given the current environment.
It would be desirable if the changes did not require that the existing error calls not have to be rewritten unless they required more information.
The following is an approach that is under consideration:
Add a new error number to the file rs274ngc_return.hh -- Give it the symbol: NCE_VARIABLE.
Add a function: Interp::setError(fmt, ...) that will take an error text and arguments like printf, format the message, and save it within the interpreter data structures.
Modify the function Interp::error_text to return the last such string that has been stored if the error code is NCE_VARIABLE.
Comment are requested.