... statements ...
WHILE statement loops over its statements as long as the
given condition is true.
$loop is set to 0 before the loop is
started, and is incremented at the bottom of every iteration. The
condition has the same syntax as for
BREAK statement, if encountered, will exit the loop.
This example prints 10 image tags, for a bar graph:
<WHILE $loop lt 10>
<IMG SRC=/icons/bar.gif BORDER=0>
WHILE statement was added Feb. 6 1997.
An infinite loop can be created, if the condition is never false. Similarly, if the condition is never true, the loop is never executed.
Unlike most other looping statements,
$loop is set
WHILE condition is first executed, so it always has
the loop's value and not its previous value when the condition is