Navigation: ABC Library Reference > ErrorClass > ErrorClass Methods >====== SetId (make a specific error current) ====== | |
SetId( error id ), PROTECTED
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