| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > ErrorClass > ErrorClass Methods >====== AddErrors (add or override recognized errors) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[adderror add individual error .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[addhistory update history structure .htm|{{btn_next_n.gif|Next page}}]] | | || **AddErrors(**// error block //**), VIRTUAL** {{blk2blue.jpg|blk2blue.jpg}} | **AddErrors** | Adds entries to the Errors property from the //error block// passed to it. | | //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 **AddErrors **method receives error entries and adds them to the existing Errors property. These later added Error definitions "override" any earlier definitions with the same IDs. The "overridden" definitions are preserved for substitution into the %Previous macro symbol, and may be fully restored by removing the overriding error entries with the RemoveErrors method. **Implementation: **AddErrors 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. **Example:** **AppErrors GROUP** **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** **GlobalErrors ErrorClass                       !declare GlobalErrors object** ** CODE** ** GlobalErrors.Init                            !GlobalErrors initialization** ** GlobalErrors.****AddErrors****(AppErrors)            !add some app specific errors** ** Main                                         !call main procedure** ** GlobalErrors.Kill                            !GlobalErrors termination** **See Also:**     [[init initialize the errorclass object .htm|Init]], [[errors recognized error definitions .htm|Errors]], [[removeerrors remove or restore recognized errors .htm|RemoveErrors]]