Conditional Expression

Comparisons and Print command operands use self-typed expressions. Their type is determined by the types of variables they reference or the result type of functions the call. Self-typed expressions with mixed type operands are not allowed unless type casting functions are used.


A comparison can be coded in three different forms. You can compares two expressions with a comparison operator. For integer expressions the inequality operators are signed. They can also be compared using the unsigned comparison operators.


In many cases can omit the second expression and the comparator. When the expression is set the condition is met.


With a Comparison List you can compare an expression to a list of constants or a range of values. In this example C has type Byte and is compared to see if it is a plus or minus sign or a decimal digit.


You can use either a "=" or "~=" comparator in a comparison list. The expression on the left side can be either an integer or enumerated type. Use the "to" keyword to specify a range of values. The comparison for the range is unsigned unless the constant for the start of the range is negative.


You can include multiple comparisons in a compound condition with the "and" and "or" keywords. Each comparison is evaluated left to right and will terminate early when a comparison resolves the compound condition. After termination any subsequent conditions will not be evaluated.

In this example if the Pointer is null then the condition as a whole is false and the second comparison will not be performed. This avoids dereferencing the null pointer in the second comparison.


"And" compound operations take precedence over "or". Parenthesis are not permitted, but the condition "A or B and C or D" would be interpreted as:

Arithmetic Expression

Intrinsic Function