MESSAGE( ) Function

Returns the current error message or the program line that caused the error.

MESSAGE([1])

Parameters

  • [1]
    Return the program source code that caused the error if MESSAGE( ) is included in an ON ERROR routine.

    Note

    MESSAGE(1) is not available in the runtime.

    If the program source code is not available, MESSAGE(1) returns one of the following:

    • The entire program line if the line is macro-substituted.

    • A command if the line contains a command without any additional clauses.

    • A command followed by three dots (...) if the line contains a command and additional clauses.

Return Value

Character. MESSAGE( ) returns the current error message as a character string or the contents of the program line causing the error.

Remarks

Unlike ERROR( ), MESSAGE( ) is not reset by RETURN or RETRY.

Example

The following example displays output using the MESSAGE( ) function.

ON ERROR DO Errhand

** The next line should generate an error ** USE Nodatabase ON ERROR && Restore system error handler. PROCEDURE Errhand ? 'Line of code with error: ' + MESSAGE(1) ? 'Error number: ' + STR(ERROR( )) ? 'Error message: ' + MESSAGE( )

See Also

Reference

ERROR Command

ERROR( ) Function

ON ERROR Command

AERROR( ) Function

Error Messages Listed Alphabetically

Error Messages Listed Numerically

Other Resources

Functions