|Format: <for Expression=Expression Expression Expression> heitml <forsep> heitml </for>|
Purpose: The for tag is used to program a loop.
First, the assignment expression is evaluated. In general, the assignment expression initializes the loop variable. The second expression is evaluated before each loop iteration and must result in a Boolean expression. While the second expression evaluates to true, the actions defined in the body of the loop are executed. After each loop iteration, the third expression is evaluated. In general, the third expression increments or decrements the loop variable.
An optional forsep section can be specified which is executed between two loop iterations. In contrast to the third expression of the for tag which is evaluated after each loop iteration, the forsep section is not executed after the last loop iteration.
An alternative to the for loop is the while loop. To loop over all fields of an object or all characters of a string, use the forin loop.
<for i=0 i≤10 i=i+1; ? i*2; forsep>,< /for>
|Note: The for Tag is Case Sensitive, which means that heitml will not recognize it if you use capital letters (e.g. <FOR Expression>).|