$WBFOR - unconditional (for...next) loop

Availability
$WBFOR is available for use with all WBSP commands.

Syntax
$WBFOR{VarName|Start|End|Step|Content}
$WBFOR[VarName|Start|End|Step|Content]

Parameters
VarName - the name of the variable used as a loop counter. The variable can be accessed using $WBGETV function (see the example)
Start - initial value of loop counter.
End - final value of loop counter.
Step - optional parameter - amount counter is changed each time through the loop. It can be either positive (when start < end) or negative (when start > end). If not specified, step defaults to 1 (one).
Content - block of code (including WhizBase elements) that will be repeated through the loop

Returns
Code contained in content repeated through the loop.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
  <title>WBFOR</title>
</head>
<body>
$WBFOR[LCnt|20|2|-2|Counter value: $wbgetv[LCnt]<br>]
</body>
</html>

After running this example, the resulting page in browser, should look like this:

Counter value: 20
Counter value: 18
Counter value: 16
Counter value: 14
Counter value: 12
Counter value: 10
Counter value: 8
Counter value: 6
Counter value: 4
Counter value: 2