AddError (add individual error) 

Top  Previous  Next

 

AddError( ErrorID, Message, Title, Fatality, Category)

AddError

Add an error to the error entry queue specified by the error message identifier.

ErrorID

A USHORT value (usually an EQUATE) that identifies the error message identifier stored in the ErrorClass Errors QUEUE

Message

The label of a string field that contains the specific error message text.

Title

The label of a string field that contains the error window’s caption bar text.

Fatality

A BYTE constant or variable (usually an EQUATE) that identifies the severity error level.

Category

The label of a variable length string that represents an optional category for this error. If blank, the value of the DefaultCategory PRIVATE ErrorClass property is used.

AddError is a VIRTUAL method used to add a custom error and its necessary information to the ErrorClass Errors QUEUE. This method is the only way to reference the Errors PRIVATE property, which is needed for proper error handling in a multi-threaded environment.

Implementation:

When overriding a specific error, this virtual method should be called after using RemoveError to remove the default entry. Both methods should be called after the ErrorClass Init method.

Example:

CODE

GlobalErrors.Init(GlobalErrorStatus)

INIMgr.Init('.\IMPeople.INI', NVD_INI) ! Configure INIManager to use INI file

DctInit

GlobalErrors.RemoveError(Msg:LogoutFailed)

MessStr = 'You are not allowed to delete this record'

MessTitle = 'Test Error'

MessCat = ''

GlobalErrors.AddError(Msg:LogoutFailed,MessStr,MessTitle,Level:Notify,MessCat)

 

See Also:     RemoveError