With my Mandelbrot explorer (
https://code.google.com/p/xpost/downloads/detail?name=mandel2.ps),
I'd like to be able to interrupt the drawing and return to the menu if
the resolution is too high and it's taking too long.
The PLRM, 1ed, says
> interrupt (error)
> processes an external request to interrupt execution of a PostScript
> program. When the interpreter receives an interrupt request, it executes
> interrupt as if it were an error (i.e. it looks up the name 'interrupt' in
> errordict). Execution of interrupt is sandwiched between execution of
> two objects being interpreted in normal sequence.
> The precise nature of an external interrupt request depends on the en-
> vironment in which the PostScript interpreter is running. In typical
> environments, receipt of a control-C character from a serial communi-
> cation channel gives rise to the interrupt error. This permits a user to
> explicitly abort a PostScript computation. The default definition of
> interrupt executes a stop.
I tried wrapping the drawing functions in a stopped context.
% The Main Loop
% - draw the object according to currrent parameters
% - enter menu loop
% - showpage
{
{
createtable findmaxmin sketch flushpage
} stopped clear
menu
showpage
} loop
But ctrl-C just kills the whole interpreter.
Is there a special mode or flag to enable /interrupt errors with GS?