A.3.4.1 If/Else Statements

The following if commands enable branching based on different conditions:

Command

Description

ifstr

ifstr Value1 {==|!=} Value2

Compare Value1 to Value2, case sensitively

ifstr(i)

ifstr(i) Value1 {==|!=} Value2

Compare Value1 to Value2, case insensitively

ifint

ifint Value1 {==|!=|<=|>=|<|>} Value2

Compare Value1 to Value2 as integers, after using the atol() function to convert the value strings into LONG values.

ifcontains

ifcontains Value {in|not-in} List

Compares case-sensitively the Value string to the string items in List. The “in” and “not-in” comparison operators enable branching based on whether the string is in or not in the list.

ifcontains(i)

ifcontains(i) Value {in|not-in} List

Same as ifcontains, except that comparisons are case-insensitive.

For every if... command variation, there is a corresponding else-if... command, that uses the same syntax.

The various if statements are followed by a block of lines that are executed if the expression evaluates to TRUE. The block is terminated by either an endif statement or by one of a set of else statements (else, else-ifstr, else-ifstr(i), else-ifint, else-ifcontains, or else-ifcontains(i)). For every if... or else-if... statement, there must be a corresponding endif statement. If statements can be nested. For example:

ifstr
    .
    .
    .
else-ifint
        .
        .
        .
    else
        .
        .
        .
    endif
endif