<cfbreak>

Used to break out of a cfloop,cfwhile or cfforeach.

This tag cannot have a body.

This tag is also supported within <cfscript>

Attribute Description
label
string, optional

used to address a specific loop instead of the nearest one.

<cfbreak #string label#>

Examples

// breaking out using a label
x = 0;
WhileLabel: while (x < 10){    
    writeOutput("x is #x#<br>");
    switch (x){
        case 1:
            break;
        case 3:
            break WhileLabel;
    }
    x++;
    writeOutput("end of of loop<br>");
}
writeOutput("After loop, x is #x#<br>");

See also