<< back to sysax.com Product page

1.5. Conditional execution

A conditional statement consists of the keyword if followed by the test condition and a statement block. The statement block is mandatory. An else keyword may also be used to specify an alternate condition.

String comparison operators are:

eq    (equality)
ne    (inequality)
lt    (less than)
le    (less than or equal to)
gt    (greater than)
ge    (greater than or equal to)

Numeric comparison operators are:

==    (equality)
!=    (inequality)
<     (less than)
<=    (less than or equal to)
>     (greater than)
>=    (greater than or equal to)

Arguments are automatically treated as strings or numbers based on the comparison operator that is used. Strings may also contain wildcards such as *.

Exhibit 1.5. Syntax of conditional execution statement

if <test condition> begin

end



if <test condition> begin

end else begin

end

Exhibit 1.6. Examples for using the conditional execution statement

if ~numvar < 5 begin

end



if ~strvar eq "*.txt" begin

end else begin

end