webCOMAND

#WHILE

Execute and repeat a block of cTemplate if a condition as long as the condition is true at the before it is executed each iteration.

Prototype

#WHILE(condition) ... #ENDWHILE

Parameters

Example

#ASSIGN($i, 1)
#WHILE($i<=3)
    Iteration $i<br/>
    #ASSIGN($i, $i+1)
#ENDWHILE

Result

Iteration 1
Iteration 2
Iteration 3

Related

#FOR, #FOREACH