User Tools

Site Tools


removeerrors_remove_or_restore_recognized_errors_.htm
Navigation:  ABC Library Reference > ErrorClass > ErrorClass Methods >====== RemoveErrors (remove or restore recognized errors) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

RemoveErrors(// error block //)

blk2blue.jpg

RemoveErrors Removes the entries specified in the error block from the Errors property.
error block A GROUP whose first component field is a USHORT containing the number of error entries in the GROUP. Subsequent component fields define the error entries.

The **RemoveErrors **method receives error entries and deletes them from the existing Errors property.

The Errors property may contain more than one error with the same ID. Errors added later override earlier added errors with the same IDs. If you remove an overriding error definition, the “overridden” error is fully restored.

Implementation:

RemoveErrors assumes the Errors property has already been created by Init or by some other method.

Each// error block// entry consists of a USHORT containing the error ID, a BYTE containing the severity level, a PSTRING containing the title to display on the error message window, and another PSTRING containing the error message text. However, RemoveErrors only considers the error ID when removing errors.

Example:

GlobalErrors ErrorClass                     !declare GlobalErrors object

Payroll PROCEDURE

PayErrors GROUP,STATIC

Number     USHORT(2)                        !number of errors in the group

**           USHORT(Msg:RebuildKey)           !first error ID**

**           BYTE(Level:Notify)               !severity level**

**           PSTRING('Invalid Key')           !window title**

**           PSTRING('%File key is invalid.') !message text**

**           USHORT(Msg:RebuildFailed)        !second error ID**

**           BYTE(Level:Fatal)                !severity level**

**           PSTRING('Key was not built')     !window title**

**           PSTRING('Repairing key for %File.')  !message text**

**          END**

** CODE**

** GlobalErrors.AddErrors(PayErrors)          !add Payroll specific errors**

** !process payroll**

** GlobalErrors.RemoveErrors(PayErrors)       !remove Payroll specific errors**

See Also:     AddErrors, Init, Errors

removeerrors_remove_or_restore_recognized_errors_.htm.txt · Last modified: by 127.0.0.1