<cfbreak>
Used to break out of a <cfloop> or <cfwhile>
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfbreak #string label#>
Attribute | Description |
---|---|
label
string, optional
|
used to address a specific loop instead of the nearest one. |
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 loop<br>");
}
writeOutput("After loop, x is #x#<br>");
See also
- <cfloop>
- <cfwhile>
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)