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 CONDITION attribute creates a while loop that repeats while a specified expression is True. In order to work, the expression being tested must change with each iteration until the condition evaluates to False. Can’t be used with any other attributes.

COLLECTION=" COM_object_or_CF_structure "

The COLLECTION attribute loops over a COM collection object or a ColdFusion structure. Requires the ITEM attribute 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 COLLECTION loop. Required with COLLECTION.

INDEX=" index_name "

Using the INDEX attribute creates a for loop. This loop either repeats a specified number of times, when used with the FROM, TO, and STEP attributes; or loops through a list, with the LIST and DELIMITERS attributes. INDEX specifies a variable that can access the current value of the index loop. When used with the FROM, TO, and STEP attributes, the INDEX value is set to the FROM value (required) and incremented by the STEP value (optional) for each iteration of the loop until the TO value (required) is reached. When used with the LIST (required) and DELIMITERS (optional) attributes, INDEX is a place holder for the current list item. Can’t be used ...

Get Programming ColdFusion 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.