webCOMAND

#FOR

Repeat a block of sScript based on an initializer, condition and adjustment.

Syntax

#FOR(initializer; condition; adjustment) ... #ENDFOR

Parameters

  • initializer - An expression typically used to initialize a variable, such as $i = 1
  • condition - An expression that determines if the block should repeat again (TRUE) or terminate (FALSE), such as $i < 10
  • adjustment - An expression typically used to update a variable that will eventually cause the condition to fail, such as $i = $i + 1

Example

#FOR($i=0; $i<3; $i=$i+1)
    Iteration $i<br/>
#ENDFOR

Result

Iteration 1
Iteration 2
Iteration 3