ErrorLevel

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloEnv > TApolloEnv Methods >

ErrorLevel

Declaration

function ErrorLevel( const iErrorLevel: Integer ) : Integer;

Description

Sets the level of automatic error messaging used by Apollo. This allows the developer to control the severity level that will result in Apollo displaying its own error message box.

 

For example, if ERRLEVEL_STANDARD is passed, and you attempt to activate a table that does not exist, you will see Apollo's standard "Error 1800 - File Not Found" message box. Upon clicking the OK button, the next line of your Delphi code would be executed. If you prefer to handle this type of error yourself through Delphi's exception handling syntax (try...except), you should set this level to ERRLEVEL_NONE or ERRLEVEL_FATAL (the default value).

Parameters

iErrorLevel: Any one of the following constant values:

 

ERRLEVEL_NONE  0 No error message at all.

ERRLEVEL_FATAL  1 Only report Fatal errors (Default).

ERRLEVEL_STANDARD 2 Report all errors.

Returns

The previously active Error Level value is returned.

Delphi Example

// Turns off all of Apollo's standard error messages 

ApolloEnv1.ErrorLevel( ERRLEVEL_NONE ); 

try

 ApTbl.Open; 

except

 ShowMessage( 'Unable to open: ' + ApTbl.TableName ); 

end;

See Also

SetErrorFunc, Error Handling