Chapter 4. Commands

Table of Contents

if
while
for
foreach

Various structure commands are supported. They can be freely nested.

There are also three special commands: exit, break and continue. The first one ends script execution and returns. The second exits current block (while, for or foreach and the third exits just a current step, restarting from the beginning of the loop.

if

Command if has following syntax:

if condition then code elseif condition then code else code endif

Both elseif and else parts are optional. Condition is any expression. Code is executed if condition is true. That means:

  • non-zero for integers and double
  • non-empty for strings

if a * 2 ≥ 7 then
   b = 1
elseif a ≤ 0 then
   b = 2
elseif 
   b = 0
endif