Expressions

Expressions are used in several places to do a comparison between two values resulting in a true or false value that is used to determine which actions to take next. These expressions are used in the visible, required, editable, and parsing expressions.

Expressions use these three comparison functions, all required, to check values in screen fields:

  • EXPRC(value1, value2, operator): Compares as a string
  • EXPRI(value1, value2, operator): Compares as an integer
  • EXPRF(value1, value2, operator): Compares as a decimal

These parameter values are valid:

  • Value1 and Value2
    • A literal value
    • A variable in the form of a field reference. Reference format is VECTOR > FIELD
  • Operator
    • These values are valid:
    • =
    • != or <>
    • >
    • <
    • >=
    • <=

Examples:

This statement compares the value of a screen field to a literal integer value.

(EXPRI(RECEIVE->rectype,9,=))

This statement compares the value of a screen field to a literal string value.

(EXPRC(RECEIVE->miscmsg,ERROR,!=))

This statement compares the decimal value of a screen field to the decimal value of different screen field.

(EXPRF(SEND->awgt,SEND->wgt,!=))

Comparison functions can be joined with logical AND (&) operator to create Inner Expressions.

(EXPRI(RECEIVE->rectype,9,=) & EXPRC(RECEIVE->status,HOLD,=))

Multiple Inner Expressions can be joined together with the logical OR (|) operator to create the Expressions.

(EXPRI(DISPLAY->disp_standard,1,=) & EXPRI(RECEIVE->rectype,9,!=)) | (EXPRI(DISPLAY->disp_actual,1,=) & EXPRI(RECEIVE->rectype,9))

The OR operator cannot be used in inside Inner Expressions and the AND operator cannot be used to join Inner Expressions together. In other words, the AND operators are evaluated first, then the OR operators.

Examples of valid expressions:

(EXPRI() & EXPRI()) | (EXPRI())

(EXPRI() & EXPRI()) | (EXPRI() & EXPRC())

Examples of invalid expressions:

(EXPRI() & EXPRI() | EXPRI())

(EXPRI() | EXPRI()) & (EXPRI())