Jaap's Psion II Page

                                CHAPTER 21

                              _____ ________
                              ERROR HANDLING



This chapter describes the error handling services ER$LKUP and ER$MESS.



        _______
21.0.1  ER$LKUP


VECTOR NUMBER :         013

INPUT PARAMETERS :      B = error number

OUTPUT VALUES :         X = address of error message

DESCRIPTION

Given an error code in B, returns the  address  of  the  appropriate  error
message  in  X.  The returned error message is a leading count byte string.
If there is no error message for this error code, the default message  "***
ERROR ***" is returned.  ER$LKUP is called by the OPL function ERR$.

EXAMPLE

        LDA     B,ERROR_CODE    ; B = ERROR CODE
        OS      ER$LKUP
        LDA     B,0,X           ; GET LENGTH BYTE
        INX                     ; SKIP PAST
        OS      DP$PRNT         ; PRINT THE ERROR MESSAGE

ERRORS

        NONE



          _______
21.0.1.1  ER$MESS


VECTOR NUMBER :         032

INPUT PARAMETERS :      B = error number

OUTPUT VALUES :         NONE

DESCRIPTION

Displays the error message associated with  the  error  code  given  in  B.
ER$MESS then waits for the user to press SPACE or ON/CLEAR.  If there is no
error message for this error code, the default message "*** ERROR  ***"  is
displayed.

NOTE :  In the case of B = 194, the machine displays the  message  "BATTERY
TOO LOW" for 4 seconds, then switches off.

EXAMPLE

        LDA     B,ERROR_CODE
        OS      ER$MESS

ERRORS

        NONE