This is a simple loop known from programming languages. It iterates, until the end expression is true. The instruction takes three parameters:
Table 2.10. For: parameters
Name | Type | Required? | Description |
---|---|---|---|
begin | Expression | Yes | Starting condition (i.e. iterating variable initialization). |
end | Expression | Yes | Ending condition. The loop iterates, until it is true. |
iterate | Expression | Yes | Iterating expression executed every call. |
separator | Expression | No | A separator inserted between two section elements. The parameter can be replaced with the separator instruction. The parameter is available since OPT 1.1.3. |
Example 2.58. Displaying numbers from 1 to 10
{for begin="@a is 1" end="@a <= 10" iterate="@a++"} <p>{@a}</p> {/for}
This instruction can be used with separators.