PML Expressions
- Last UpdatedJan 08, 2024
- 1 minute read
An expression consists of operators and operands.
For example:
2 + 3
is an expression, where 2 and 3 are the operands, and + is the operator. The result of this expression is 5.
Expressions can (and normally do) contain variables and, in Marine, expressions will often contain names of Marine element types, attributes and pseudo-attributes.
Expressions can also contain arithmetic and trigonometric functions, such as the SIN trigonometric function.
Often, expressions will contain logical operators :
!height GT !width
Here the logical operator GT is being be used to test if !height is greater than !width.
Each expression has a type such as REAL, STRING or BOOLEAN. All the elements in an expression must be of the correct type. For example:
|
!X + 'text' |
$* wrong, Wrong, WRONG! |
is meaningless if !X is REAL and will result in an error. (But see Concatenation for using the concatenation operator to convert different types to STRING.)