Return the text of the last trapped runtime error as a string, or an empty string when there has not been one.
message$ = MM.ERRMSG$
MM.ERRMSG$ is read-only. It is filled in when ON ERROR SKIP or ON ERROR IGNORE skips a statement, when OPTION ERROR CONTINUE is set, and when ON ERROR GOTO traps an error, so a handler can show what went wrong. The text is the error message without the line number or program text that the console adds.
MM.ERRMSG$ is cleared to an empty string when the program starts (RUN), and by ON ERROR SKIP, ON ERROR IGNORE and ON ERROR CLEAR. ON ERROR CLEAR only resets MM.ERRNO and MM.ERRMSG$; it leaves the active error mode in force. Use ON ERROR ABORT, or plain ON ERROR with OPTION ERROR ABORT, to stop trapping.
See also MM.ERRNO, ON, RESUME.
Example:
ON ERROR SKIP 1
OPEN "C:/.scores" FOR OUTPUT AS #1
IF MM.ERRNO <> 0 THEN PRINT "Cannot save: "; MM.ERRMSG$
ON ERROR ABORT
Source: docs/help/mm-errmsg-dollar.txt inmmcore. On the computer, typeHELP MM.ERRMSG$.