Name
cfloop
Synopsis
[<cfloop index="index_name" from="integer" to="integer" [step="integer"]>]
[<cfloop condition="expression">]
[<cfloop index="index_name" list="list" [delimiters="delimiters"]>
[<cfloop query="query_name" [startrow="integer"] [endrow="integer"]>]
[<cfloop collection="COM_Object|Structure" item="collection|key">]
HTML and CFML
</cfloop>
A looping construct that can implement different kinds of looping, depending on the attributes specified. ColdFusion has five basic loop types: index, conditional, list, query, and collection.
Attributes
-
collection="
COM_Object
|
Structure
"
The
collection
attribute loops over a COM collection object or a ColdFusion structure. Requires theitem
attribute and can’t be used with any other attributes.-
condition="
expression
"
Using the
condition
attribute creates awhile
loop that repeats while a specified expression istrue
. In order to work, the expression being tested must change with each iteration until the condition evaluates tofalse
. Can’t be used with any other attributes.-
delimiters="
delimiters
"
The characters used to separate items in the list. Optional. The default delimiter is a comma.
-
endrow="
integer
"
Row to stop looping. Optional. By default, ColdFusion continues the loop until it reaches the end of the record set.
-
from="
integer
"
Number specifying the beginning value for the loop. Required when
index
is used to loop through a range of values.-
index="
index_name
"
Using the
index
attribute creates afor
loop. ...
Get Programming ColdFusion MX, 2nd Edition 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.