cfexit
This tag aborts processing of the currently executing CFML custom tag, exits the page within the currently executing CFML custom tag, or re-executes a section of code within the currently executing CFML custom tag.
<cfexit>
exit;
Attribute Reference
method string
exittag: aborts processing of currently executing tag exittemplate: exits page of currently executing tag loop: reexecutes body of currently executing tag
Values:
exittagexittemplateloop
Compatibility
BoxLang:
Version 1.0.0+
<bx:exit> in BoxLang Examples Sample code using the cfexit tag
Here the loop over the 5 number. When it's meet the condition as true then the block of code get exit.
<cfoutput>
<cfloop from="1" to="5" index = "i">
<cfif i EQ 3>
<cfexit>
<cfelse>
#i#
</cfif>
</cfloop>
</cfoutput> Expected Result: 1 2
© 2012–present Foundeo, Inc. and the CFDocs contributors.
Licensed under the MIT License.
ColdFusion is a trademark of Adobe Systems Incorporated.
https://cfdocs.org/cfexit