
This page describes a simple error trapping scheme to allow you to trap error before a report is printed on paper.
You are free to develop your own methods for trapping error messages.
Our Superbase bar code function library references two global variables;
GLOBAL ErrorMsg$ GLOBAL HideErrors%% |
If HideErrors%% <> 1 then bar code functions will output error messages (to window Bar code errors).
If HideErrors%% = 1 then bar code functions will hide error messages (no error messages are output).
If ErrorMsg$ = "" then bar code functions will set ErrorMsg$ to the error messages.
If ErrorMsg$ <> "" then bar code functions will not set ErrorMsg$.
Before you run the report, set HideErrors%% and set ErrorMsg$ to "".
HideErrors%% = 1
ErrorMsg$ = ""
|
When the report is running no error will be displayed.
When the report is complete, ErrorMsg$ will contain the first error found.
|
TIP: You can output a report to a window or temporary file, before you print the report on paper. In your code, if ErrorMsg$ is empty then the report will complete successfully when printed. |
...
HideErrors%% = 1
ErrorMsg$ = ""
REM This is the data to bar code
B$ = "82402348"
A$ = CIA_ITF$( B$ )
REM If there is an error, display it
IF ErrorMsg$ <> "" THEN
? ErrorMsg$
END IF
...
|
Before you run the report, set ErrorMsg$ to "" and set HideErrors%% to 1.
|
Copyright © 2000 CIA (BAR CODES) UK. All rights reserved. Reproduction prohibited. |