2.6.1 Condition to Check
Mandatory.
Specify an expression that can be evaluated and produces a "true" or "false" result.
The expression must be syntactically correct. Expression evaluation is left to right within brackets, so use brackets whenever in doubt as to the order in which the expression will be evaluated. Expression components are checked for type and length compatibility. Error messages are issued that indicate any problems found when attempting to evaluate the expression.
Rules
Valid expression operators are:
( |
Open bracket |
) |
Close bracket |
+ |
Add |
- |
Subtract |
/ |
Divide |
* |
Multiply |
= |
Compare equal |
^= |
Compare not equal |
*EQ |
Compare equal |
*NE |
Compare not equal |
|
|
*NE= |
Compare not equal |
< |
Compare less than |
> |
Compare greater than |
*LT |
Compare less than |
*GT |
Compare greater than |
<= |
Compare less than or equal to |
>= |
Compare greater than or equal to |
*LE |
Compare less than or equal to |
*GE |
Compare greater than or equal to |
AND |
And |
OR |
Or |
Components of the expression can be:
- An alphanumeric literal such as 'NSW', NSW, 'Balmain' or BALMAIN
- A numeric literal such as 1, 14.23, -1.141217.
- Another field name such as #CUSTNO, #INVNUM, etc.
- A system variable name such as *BLANKS, *ZERO, *DATE or any other system variable defined at your installation.
- A process parameter such as *UP01, *UP02, etc.
- Alphanumeric literals do NOT have to be in quotes when used in an expression. Quotes are only required when the alphanumeric literal contains lowercase characters. If no quotes are used the alpha literal is converted to uppercase. Thus BALMAIN = balmain = Balmain = balMAIN. However, Balmain does not equal 'Balmain'.
- Field names must be preceded by a # (hash) symbol when used in expressions. This allows LANSA to differentiate between fields and alphanumeric literals. For instance the expression CNTRY = AUST does not indicate which of the components is the field and which is the alphanumeric literal. The correct format is #CNTRY = AUST or #CNTRY = 'AUST'.