Errcmnd$ (Function)

Gets the Error occurrence commands during exception handling.

Errcmnd$

Parameters
None.

Return Value
Returns the value of the character string.
The content of the value is the command character string generated by the error.

Description
Gets the error command character string when a Macro Error is generated.
The command character string gotten will be an alphabetic upper case character string.
When no error has occurred a null string ("") is returned.
In cases where an error occurs somewhere other than in command processing (i.e. an error such as that caused by dividing by zero in calculation), a null string ("") is returned.
This is used between the catch~end try of try ~ catch ~ end try.

Example
Writing data to a file. 
*DATAWRITE

    Try
        Open "/C0/DATA.DAT" for OUTPUT as #1
        Print #1, DATA$
        Close
    Catch

        ' In the case where the error is generated by the "open" command.

        If ERRCMND$ = "Open" Then
        Print "Unable to open file"

        ' In the case where the error is generated by the "print" command.

        Elseif ERRCMND$ = "Print" Then
        Close
        Print "Writing failed"
        Endif
    End try

Return