OnError

concerns

The OnError event is called if an error has occurred.

In order to receive the event, some preparatory actions must be taken:

1.  In an object that is available at run time, provide a class variable from the Type COM pointer, and then set the class to TCEServer.ErrorObject. Initialize the class variable with Err.

 

2.  Now set the DisplayLevel of the Err object to use the OnError event to handle errors.

 

Err.DisplayLevel := TCEServer.ErrorDisplay.ErrorRaiseOnErrorEvent

 

 

As a result, all unhandled bugs are forwarded to the OnError event. You can use this event to log the errors that have occurred in a log file or database.

 

Syntax

OnError(ErrNum, ErrDesc, ErrHelpContext, HelpFile, ClassName, FunctionName, Line, FunctionText, ContinueMode)

Return value

None

Parameter

Name

Type

Passing

Description

ErrNum

Long

ByVal

Number of the error that occurred

ErrDesc

String

ByVal

Error text

ErrHelpContext

String

ByVal

Context information

HelpFile

String

ByVal

Name of the help file

ClassName

String

ByVal

The class name of the object in which the error occurred

FunctionName

String

ByVal

The Name of the function, if available

Line

Long

ByVal

The line number in which the error occurred

FunctionText

String

ByVal

The text of the function (RTF)

ContinueMode

ContinueModes

ByRef

The procedure of continuation

 

ContinueModes

Description

0 – Continue

The application continues, however, the function in which the error occurred is aborted

1 – SwitchToDebug

If possible, it will be switched to the debugger