TPUHELP.HLB  —  ERROR
  ERROR

  Returns a keyword for the latest error encountered by DECTPU.  The value
  returned by ERROR is only meaningful inside an error handler.  The value
  returned outside an error handler is indeterminate.

  Syntax

     keyword := ERROR

  Parameters

     none

  Example

  The following code fragment is an error handler that uses the ERROR
  built-in to determine what error invoked the error handler.  If the error
  was that SEARCH could not find the specified string, then the procedure
  returns normally.  If the error was something else, then the text of the
  error message is written to the message buffer and any executing
  procedures are aborted.

     ON_ERROR
       IF ERROR = TPU$_STRNOTFOUND
          THEN
             RETURN;
          ELSE
             MESSAGE (ERROR_TEXT);
             ABORT;
       ENDIF;
     ENDON_ERROR;

  Related Topics

     ERROR_LINE   ERROR_TEXT   MESSAGE   MESSAGE_TEXT
Close Help