<cfwhile>

Simplification of the tag cfloop-condition, analog to the cfscript "while" loop.

Usage

<cfwhile
    [condition=boolean]
    [label=string]
><!--- body ---></cfwhile>

This tag must have a body.

This tag is also supported within cfscript

Attributes

Attribute Description
condition
(boolean, optional)

condition o the expression

label
(string, optional)

used to a address this loop from a "break" or "continue" statement (instead of the nearest one).

Examples

testCondition = true;
cnt = 0;
while(testCondition) {
    cnt = cnt + 1;
    if (cnt EQ 5) {
        testCondition = false;
    }
}
echo(cnt);

See also

  • tag-break