AddError Method (ERROR)


10.1, PLBCMP GUI Only

 

The AddError method inserts a user error 'Lxx' as a trappable error or a 'lxx' as an untrappable error. The method uses the following format:

 

 

[label]

{object}.AddError

[GIVING {return}] using [*Code={code}[:

 

 

 

[*SUBCODE=]{subcode}][:

 

 

 

[*MESSAGE=]{message}][:

 

 

 

[*Flags=]{flags}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. An ERROR object that is accessed.

return

Optional. A Numeric Variable that returns the error stack position for the error being added. The stack position value is one relative.

code

Required. A Numeric Variable or decimal number with a value which is the basic error code value. This value can be from 0 to 99.

subcode

Optional. A Numeric variable or decimal number that is a 32 bit subcode value.

message

Optional. A Character String Variable or string literal that specifies the description for the user error.

flags

Optional. A Numeric Variable or decimal number that specifies a bit mask value that controls the behaviors of this method.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The ZERO flag is set if the {return} value is zero.

  2. The OVER flag is set if the returned value overflows the {return} Numeric Variable.

  3. The EOS flag is always cleared.

  4. The {flags} bit mask values are described as follows:

  5.  

    Value

    Keyword

    A user error is added that is ...

    0x1

    PLBERR_USER_EXCEPTION

    trappable.

    0x2

    PLBERR_USER_NOEXCEPTION

    not trappable (default).

 

 

See Also: Method Syntax, ERROR Methods



PL/B Language Reference ClearAll Method (ERROR)