Returns the current error message or the program line that caused the error.
Return the program source code that caused the error if MESSAGE(В ) is included in an ON ERROR routine.
If the program source code is not available,
MESSAGE(1)is not available in the runtime.
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.
- The entire program line if the line is macro-substituted.
Character. MESSAGE(В ) returns the current error message as a character string or the contents of the program line causing the error.
Unlike ERROR(В ), MESSAGE(В ) is not reset by RETURN or RETRY.
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( )