Looping over a List


<CFLOOP INDEX="index_name"
    LIST="list_items"
    DELIMITERS="item_delimiter">
</CFLOOP>

Looping over a list offers the option of walking through elements contained within a variable or value returned from an expression. In a list loop, the INDEX attribute specifies the name of a variable to receive the next element of the list, and the LIST attribute holds a list or a variable containing a list.

INDEX

Required. In a list loop, the INDEX attribute specifies the name of a variable to receive the next element of the list, and the LIST attribute holds a list or a variable containing a list.

LIST

Required. The list items in the loop, provided directly or with a variable.

DELIMITERS

Optional. Specifies the delimiter characters used to separate items in the LIST.