CFBREAK

Used to break out of a CFLOOP. See Breaking out of a loop, later in this chapter, for more information.

Syntax

<CFBREAK>

Example

cfbreak

 <!--- This example shows the use of CFBREAK to exit a loop when a condition is met ---> <!--- select a list of courses and use CFLOOP to find a condition and then break the loop ---> <CFQUERY NAME="GetCourses" DATASOURCE="cfsnippets"> SELECT * FROM courses ORDER by Number </CFQUERY> <HTML> <HEAD> <TITLE> CFBREAK Example </TITLE> </HEAD> <BODY bgcolor=silver> <H1>CFBREAK Example</H1> <P>This example uses CFLOOP to cycle through a query to find a desired value. (In our example, a list of values corresponding to courses in the cfsnippets datasource). When the conditions of the query are met, CFBREAK ...

Get Sams Teach Yourself ColdFusion® in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.