ERROR (return error message)

Top  Previous  Next

 

ERROR( )

The ERROR procedure returns a string containing a description of any error that was posted. If no error was posted, ERROR returns an empty string. You should interrogate ERROR immediately after the statement which you suspect may post an error because processing any other statement which could post an error will clear the internal errorcode.

Return Data Type:

STRING

Example:

PUT(NameQueue)                          !Write the record

IF ERROR() = 'Queue Entry Not Found'    !If not found

ADD(NameQueue)                         !add new entry

 IF ERRORCODE()                        !Check for unexpected error

  STOP(ERROR())

 END

END

 

See Also:

ERRORCODE

ERRORFILE

FILEERROR

FILEERRORCODE

POPERRORS

PUSHERRORS

Trappable Run Time Errors