Output Errors

The global variable prn_error may be set at any time by the output code to indicate that an error has occurred. The application can discover the value of this variable in order to test for errors. The values put in this variable are application-dependent.

If asynchronous printing is implemented, the application writer should be aware that an error reported by setting prn_error might refer not to the last line sent for printing, but to some previous line.

The application may continue to send output commands after the prn_error variable is set, until it happens to test its value. Thus the code of prn_print() might have to test prn_error before attempting to print, in case an error has already occurred, and if so to take suitable action.

The action to take if more printing is attempted after an error has occurred is obviously application-dependent, but a possible approach would be for prn_print() to return 0 to queue up the printing to be done later after the error has been corrected (see Reprinting After Errors); this approach could be taken even if asynchronous printing is not implemented.