!ERRTEXT()

!ERRTEXT()

Top  Previous  Next

 

The !ERRTEXT() subroutine returns a text description of an error number.

 

 

Format

 

CALL !ERRTEXT(text, qm.error{, os.error})

 

where

 

textis the returned descriptive text.

 

qm.erroris the QM error number, typically from the STATUS() function.

 

os.erroris the operating system error number, typically from the OS.ERROR() function. If this argument is omitted, it defaults to the current value of the OS.ERROR() function.

 

 

The !ERRTEXT() subroutine can be used to retrieve a text description of a QM error number for display to a user or entry into a log file.

 

Where relevant, the associated operating system error number will be inserted into the text. For this to be correct, the !ERRTEXT() subroutine must either be called before any actions are performed that might lose this value (e.g. file operations) or the error number must be passed as the optional os.error argument.

 

If qm.error is not recognised, the subroutine returns qm.error as the text description.

 

 

Examples

 

CALL !ERRTEXT(TEXT, STATUS())

DISPLAY 'Error ' : STATUS() : ' ' : TEXT

or

DEFFUN ERRTEXT(ERRNO) CALLING "!ERRTEXT"

DISPLAY 'Error ' : STATUS() : ' ' : ERRTEXT(STATUS())