Name
CFLOOP
Synopsis
<CFLOOP>
HTML and CFML
</CFLOOP>A looping construct that can implement different kinds of looping, depending on the attributes specified.
Attributes
-
CONDITION="expression" Using the
CONDITIONattribute creates awhileloop 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.-
COLLECTION="COM_object_or_CF_structure" The
COLLECTIONattribute loops over a COM collection object or a ColdFusion structure. Requires theITEMattribute and can’t be used with any other attributes.-
ITEM="collection_or_key" The variable name for the collection (COM object) or key (ColdFusion structure) referenced in a
COLLECTIONloop. Required withCOLLECTION.-
INDEX="index_name" Using the
INDEXattribute creates aforloop. This loop either repeats a specified number of times, when used with theFROM,TO, andSTEPattributes; or loops through a list, with theLISTandDELIMITERSattributes.INDEXspecifies a variable that can access the current value of the index loop. When used with theFROM,TO, andSTEPattributes, theINDEXvalue is set to theFROMvalue (required) and incremented by theSTEPvalue (optional) for each iteration of the loop until theTOvalue (required) is reached. When used with theLIST(required) andDELIMITERS(optional) attributes,INDEXis a place holder for the current list item. Can’t be used ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access