User Tools

Site Tools


setid_make_a_specific_error_current_.htm
Navigation:  ABC Library Reference > ErrorClass > ErrorClass Methods >====== SetId (make a specific error current) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

SetId( error id ), PROTECTED

blk2blue.jpg

SetId Makes the specified error the current one.
error id An integer constant, variable, EQUATE, or expression that indicates which error definition is current.

The SetId method makes the specified error the current one for processing by other ErrorClass methods. If more than one error definition matches the specified error id, the last defined error is used. This lets errors defined later override earlier defined errors with the same ID, while preserving the earlier defined errors for substitution into the %Previous macro symbol.

This method is PROTECTED, therefore, it can only be called from an ErrorClass method, or a method in a class derived from ErrorClass.

Implementation:

The ABERROR.INC file contains a list of default EQUATEs for the error id parameter.

Example:

ErrorClass.TakeError PROCEDURE(SHORT Id)

 CODE

SELF.SetId(Id)

CASE SELF.Errors.Fatality

OF Level:Benign

 RETURN SELF.TakeBenign()

OF Level:User

OROF Level:Cancel

 RETURN SELF.TakeUser()

OF Level:Program

 RETURN SELF.TakeProgram()

OF Level:Fatal

 RETURN SELF.TakeFatal()

OF Level:Notify

 SELF.TakeNotify()

 RETURN Level:Notify

ELSE

 RETURN SELF.TakeOther()

END

See Also:     Errors

setid_make_a_specific_error_current_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1