cbErrHandling()

Sets the error handling for all subsequent function calls. Most functions return error codes after each call. In addition, other error handling features are built into the library. This function controls those features. If the Universal Library cannot find the configuration file CB.CFG, it always terminates the program, regardless of the cbErrHandling() setting.

Function Prototype

C/C++

int cbErrHandling(int ErrReporting, int ErrHandling)

Visual Basic

Function cbErrHandling(ByVal ErrReporting&, ByVal ErrHandling&) As Long

Arguments

ErrReporting

This argument controls when the library will print error messages on the screen. The default is DONTPRINT. Set it to one of the constants in the "ErrReporting argument values" section below.

ErrHandling

This argument specifies what class of error will cause the program to halt. The default is DONTSTOP. Set it to one of the constants in the "ErrHandling argument values" section below.

Returns

ErrReporting argument values

DONTPRINTErrors will not generate a message to the screen. In that case your program must always check the returned error code after each library call to determine if an error occurred.
PRINTWARNINGSOnly warning errors will generate a message to the screen. Your program will have to check for fatal errors.
PRINTFATALOnly fatal errors will generate a message to the screen. Your program must check for warning errors.
PRINTALLAll errors will generate a message to the screen.

ErrHandling argument values

DONTSTOPThe program will always continue executing when an error occurs.
STOPFATALThe program will halt if a "fatal" error occurs.
STOPALLWill stop whenever any error occurs. If you are running in an Integrated Development Environment (IDE), when errors occur the environment may be shut down along with the program. If your IDE behaves this way, (QuickBasic and VisualBasic do), then set ErrHandling to DONTSTOP. Refer to the "Error Codes" topic for a complete list of error codes and their associated messages.

Notes