The attached patch add an "abort" command, which directly bails to the command line
(either the interactive gnuplot command line or the system command line in batch mode).
I found this especially useful for debugging nested scripts.
I am reminded that there is a Feature Request (#315) for a mechanism to catch exceptions. This isn't quite the same thing but seems related. Shouldn't there be some way for the top-level to detect that the return came from "abort" rather than normal completion? If nothing else the abort code could set GPVAL_ERRNO. But there may be a cleverer option.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have added this capability in a slightly different form. Since the action taken is close to the existing "exit/quit" command, I have added this in the form of a new option:
exiterror"error message"
In non-interactive mode it prints the message and exits. In interactive mode it prints the message and returns to the top-level command line. Because it goes via int_error() all the various error cleanup routines are called so that any subsequent top level commands start from a coherent state.
Thanks for the inspiration.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am reminded that there is a Feature Request (#315) for a mechanism to catch exceptions. This isn't quite the same thing but seems related. Shouldn't there be some way for the top-level to detect that the return came from "abort" rather than normal completion? If nothing else the abort code could set GPVAL_ERRNO. But there may be a cleverer option.
Another question.
What is the difference between "abort" and "int_error(NO_CARET, 'abort')"?
I have added this capability in a slightly different form. Since the action taken is close to the existing "exit/quit" command, I have added this in the form of a new option:
In non-interactive mode it prints the message and exits. In interactive mode it prints the message and returns to the top-level command line. Because it goes via int_error() all the various error cleanup routines are called so that any subsequent top level commands start from a coherent state.
Thanks for the inspiration.