Navigation: ABC Library Reference > ErrorClass > ErrorClass Overview >====== ErrorClass Macro Expansion ====== | |
The following ErrorClass methods allow runtime customization of error message text through expansion of macro symbols:
SetField | Names the field that produced the error. |
SetFile | Names the file that produced the error. |
ThrowFile | Names the file that produced the error, then handles the error. |
ThrowMessage | Modifies error text, then handles the error. |
Each error has associated message text. The error message text may contain macro symbols recognized by the ErrorClass object. The ErrorClass object expands these macro symbols to their current runtime values before displaying the message. Supported macros and their runtime substitution values are:
%File | The ErrorClass.FileName property |
%Field | The ErrorClass.FieldName property |
%Message | The ErrorClass.MessageText property |
%Error | Value returned by ERROR() |
%ErrorCode | Value returned by ERRORCODE() |
%FileError | Value returned by FILEERROR() |
%FileErrorCode | Value returned by FILEERRORCODE() |
%ErrorText | %Error(%ErrorCode) or %FileError(%FileErrorCode) |
%Previous | Text from prior defined error with the same id |
The %ErrorText macro uses %FileError(%FileErrorCode)–the more specific backend server error information–when it is available, otherwise it uses %Error(%ErrorCode).
This macro expansion capability is a feature of the ErrorClass and is not a feature of the Clarion language in general.
You do not need to specify two percent signs (%%) to display a percent sign (%) in your message text.