Contents of the QB45ERR.DOC file
** Quick Basic Version 4.5 Error Handler Routines **
These are a couple of subroutines that I'm using in a Multiple
Module proprietary program to "internalize" the Standard error mes-
sages, and make it possible to recover from internal program errors
without terminating the program.
They also trap out "Offline" and "Paper out" conditions on LPT1 &
LPT2, and display an error message for these conditions on line 25 of
the current screen. The Var's lneprt1 & lneprt2 are used as flags to
indicate whether their respective printers are available for use. Note
that the Error Handler will set these flags to False if it detects an
Offline or Out of Paper condition on the associated printer. Your
program needs to include a way for the user to set the appropriate
flag true again after the printer fault has been corrected.
The Main Error Handler Subroutine also has the ability to display
ten "Custom" error messages, which can be generated from within the
program by the appropriate code, such as:
IF Stuff > 10 then ERROR 200
The Error Message for code 200 Would be "Too Much Stuff" .
Also note that these Custom Error Messages can be extended out to
code 255 by adding the appropriate CASE Statements.
The Error Handler displays its messages on screen # 3 to avoid
trashing the program's current working screen. The cscrn% and vscrn%
var's point to the program's current working screen (Normally # 0).
This allows the use of screens 0, 1, & 2 on a CGA, and 0, 1, 2, 4, 5,
6, & 7 on an EGA.
The Routines can be modified to use a window if you are using one
of the window generating packages in your application.