Expression
Executes an arithmetic or logical expression.
Takes exactly two operands.
For summarization of more than two operands, see the Sum action.
Syntax:
Result = Left_Operand operator Right_Operand
This table shows the arithmetic operators:
Arithmetic operator | Operation |
---|---|
+ | A + B |
- | A - B |
* | A * B |
/ | A / B |
This table shows the logical operators:
Logical operator | Operation |
---|---|
and | A and B |
or | A or B |
This table shows the data types of the operation results for divisions:
A | B | Operation result (A / B) |
---|---|---|
long | long | long |
long | double | double |
double | long | double |
double | double | double |
Note: When the operation result is assigned to the result, a
type conversion may occur and cause side effects.
This table shows how the operation result is, possibly, converted to match the expression result type:
Result | Operation | |
---|---|---|
long | long | unchanged |
long | double | truncated |
double | long | unchanged |
double | double | unchanged |
Examples:
left value = operation (=right value)
Operation | Right value | Left value | |
---|---|---|---|
Operation result | As long | As double | |
3 / 2 | 1 | 1 | 1.5 |
3.0 / 2 | 1.5 | 1 | 1.5 |
6.3 / 2.1 | 3.0 | 3 | 3.0 |
Fields in the editor
- Result
- The field/variable to store the expression result.
- Left operand
- The left operand of the expression.
- Operator
- The operator of the expression: +, -, /, *, and, or.
- Right operand
- The right operand of the expression.
Validations
- If Field is selected, the specified field must exist in the current session.
- If Variable is selected, the specified variable must be declared.