This loop will display the names of each of the Beatles:
<CFLOOP INDEX="ListElement"
LIST="John,Paul,George,Ringo">
<CFOUTPUT>#ListElement#</CFOUTPUT><BR>
</CFLOOP>
Although CFLOOP expects elements in the list to be separated by commas by default, you are free to specify your own element boundaries in the DELIMITER attribute. Here's the same loop as before, only this time CFLOOP will treat commas, colons, or slashes as list element delimiters:
<CFLOOP INDEX="ListElement"
LIST="John/Paul,George::Ringo"
DELIMITERS=",:/">
<CFOUTPUT>#ListElement#</CFOUTPUT><BR>
</CFLOOP>
Delimiters need not be specified in any particular order. Note that consecutive delimiters are treated as a single delimiter; thus the two colons in the previous example are treated as a single delimiter between "George" and "Ringo."
|