Relational expressions for use in conditional transaction fields can consist of:
Existing field names (not system variables). Indexes are considered part of field names, so use square brackets to contain them, if they are not 0 (as shown in the examples below).
Any of the characters in the table below.
|
Character |
Meaning |
Example |
|
Arithmetic operators |
||
|
+ |
Plus |
Field[1]+Field[2]=Field[3] |
|
- |
Minus |
Field[1]-Field[2]=Field[3] |
|
: |
Sum of fields from/to |
Field[1]:Field[3]=Field[4] |
|
* |
Multiply |
FieldC<=FieldA*10 |
|
/ |
Divide |
Field[1]/2=Field[4] |
|
% |
Remainder |
FieldA%2=0 (If the statement is true, then the field contains an even value. Otherwise, the value is odd.) |
|
Conditional operator |
||
|
? |
Does the field exist? |
?Field[2] (Returns 1 if the field exists, otherwise 0. Do not use with system variables.) More info. |
|
Relational operators |
||
|
= |
Equal to |
?Mark[1]+?Mark[2]+?Mark[3]=3 |
|
> |
Greater than |
Field B>FieldC |
|
< |
Less than |
FieldC<5 |
|
>= |
Greater than or equal to |
Field[1]>=Field[4] |
|
<= |
Less than or equal to |
FieldA<=FieldB+FieldC |
|
Logical operators |
||
|
; |
And (between two expressions) |
FieldA=FieldB+FieldC; FieldA<Field[3] |
|
Other characters |
||
|
( ) |
Parentheses |
Field[4]=(Field[1]+Field[2])*Field[3] |
Though the format of an expression for conditional field is similar to the format of an expression for numerical fields and for field validations, the result of the expression does not appear anywhere in the record, nor does it validate any field. The only purpose of an expression in a conditional transaction field is to set the condition to true (¹ 0) or false (0).
Remember to type a corresponding #EndIf line, with the same Type, Format and Length but without an expression, after the conditional transaction fields.
Limitations of conditional transaction fields
Precision of calculations on values with decimals