Conditional Expression
Reference: Assign
If/End_If
While/End_While
Conditional expressions are combinations of constants and variables that resolve to a single value of true or false. In Beyond FTP, these expressions are always contained with parentheses. For example, the following are simple expressions:
( True
)
(
123 <= 254
)
(
%’Counter’ < 10
)
(
%’Fcheck’ or %’KeepGoing’ )
Expressions may be nested as well for more complex decisions. Combining the last two examples above might yield:
( ( %’Counter’ < 10 ) and ( %’Fcheck’ or %’KeepGoing’ ) )
Beyond FTP performs type checking when compiling these expressions. In the above example, the variable Counter must be assigned a numeric value. Fcheck and KeepGoing must be logical values. Beyond FTP supports the following comparison operators:
< |
Less than |
> |
Greater than |
<= |
Less than or equal |
>= |
Greater than or equal |
= |
Equal |
!= |
Not equal |
Numbers may be compared to numbers and strings may be
compared to strings. String comparisons use the collating sequence of the
local operating system. String comparisons are NOT case sensitive.
Beyond FTP supports the following logical operators:
And |
Both operands must be True |
Or |
Either operand may be True |
The Not directive may be used to invert any logical value.
The Holiday operator tests a date variable against the holiday schedule. It returns true if the date is a holiday and false otherwise. The date variable must be contained within parentheses. For example:
( Not Holiday( %’MyDate’ ) )