Return or Modify the Current Error Level

USAGE:

error.level(...)

ARGUMENTS:

...
an expression which evaluates to a positive value that either decreases the error level or adds 1 to it.

VALUE:

an integer representing the current error level. 0 is normal exit status.

DETAILS:

The error.level function can be useful in constructing a .Last function that does different things depending on whether the exit is normal or abnormal. The terminate function always increments the error level, so using it (instead of q or exit ) guarantees that you will execute the abnormal exit options.

SEE ALSO:

, , ,

EXAMPLES:

   
# Caution: This example will end your S-PLUS session
.Last <- function()
{
  if(error.level() == 0)
  cat("Normal exit.\n")
  else
  cat("Exit with problems.\n")
}
terminate()