%ERROR

The %ERROR function returns indication of whether a field is in error condition.

A regular field that does not have a function attached is in error condition if the data for that field is not valid for the field type defined. Any field that does not have a function applied is in error condition if the function cannot be evaluated for any reason. Possible reasons include:

  • Divide by zero attempted
  • Result out of range
  • Table not found
  • Referred to a field that is in error condition

Any function other than %ERROR that attempts to use a field that is in error state fails and causes the field in which it is defined to also go into an error state.

Format

%ERROR(&field)

Parameters

value

The name of the field to check, prefixed with an ampersand (&)

Return value

Returns 1 if the field is in error state, otherwise returns 0.