q(n=0)
.Last
, if it exists,
will be called or evaluated before quitting.
The
q
function is acceptable as an error option.
This can be useful, for instance, by forcing BATCH jobs
to quit on the first error.
Using an exclamation mark (!) as the first character of a command "escapes"
the command to the operating system. Such escapes can, at times, be more
efficient than quitting S-PLUS and then restarting it later.
When using the S-PLUS with the command line editor, Splus -e,
the exit status is the exit status of the command line editor,
not that of S-PLUS, so the argument to
q
cannot be used by the shell.
!vi foo # edit a file - when the editor is exited, control is returned to S-PLUS q() # quit S-PLUS % echo $status 0 % Splus options(error=expression({cat("Quitting at first error\n");q(123)})) 1///4 Syntax error: */ ("/") used illegally at this point: 1// Quitting at first error % echo $status 123