GetDescription Method (ERROR)


10.1A, PLBCMP GUI Only

 

The GetDescription method retrieves the description associated with PL/B error codes. The error descriptions are defined in XML format and can be found in the default 'plberrors.xml' or a user XML file. This method uses the following format:

 

 

[label]

{object}.GetDescription

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

 

 

 

[*SubCode=]{subcode}[,[{*Filename=]{filename}][:

 

 

 

[*Flags=]{flags}]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. An ERROR object that has been previously declared.

return

Optional. A Numeric Variable that returns the maximum number of errors allowed on the error stack.

code

Required. A Character String Variable or string literal that specifies the error code string. For example the error code can be "C09".

subcode

Required. A Character String Variable or string literal that specifies the subcode string. For example, the subcode string can be "21".

filename

Optional. A Character String Variable or string literal that specifies the file name which contains user defined error codes and descriptions.

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 OVER and ZERO flags are always set to be FALSE.

  2. The EOS flag is set to be TRUE if the {return} variable is too small to receive the description without being truncated.

  3. The {flags} bit mask values parameter is implemented for future usage.

  4. The {code} and {subcode} strings are case sensitive and must match the <Error> data exactly.

  5. If the {filename} parameter is not specified for this method, the default file name used by the PL/B runtime is 'plberrors.xml'. When the {filename} parameter is specified,the file name is a XML file that contains user error codes and descriptions. In any case, the 'plberrors.xml' or the user XML file must have the format as follows:

  6.  

    <?xml version="1.0" encoding="UTF-8"?>

      <Runtime_Errors>

      <Version>10.1</Version>

      <Error Number="A01" SubCode= "" Type="Interrupts Prevented" Description="FILEPI already in effect. Another FILEPI may not be initiated until current one expires or a FILEPI 0 or PI 0 is executed." />

      ...

      <Error Number="C09" SubCode= "20" Type="Chain" Description="Global variable declared size different from already loaded variable. Module and variable address are returned as additional information in the error variable." />

      ...

    </Runtime_Errors>

    Where:

     

    <Runtime_Errors>

    Root XML tag.

    <Version>

    Xml element tag that contains the runtime version.

    <Error>

    Xml element tag that contains the error, subcode, type, and description attributes for an error.

 

 

See Also: Method Syntax, ERROR Methods

 



PL/B Language Reference GetCount Method (ERROR) GetErrorStackSize Method (ERROR)