Loops are another fundamental language element supported by most development platforms. Loops do just that—they loop. Loops provide a mechanism with which to repeat tasks, and ColdFusion supports several types of loops, all via the <cfloop> tag:
Index loops, used to repeat a set number of times
Conditional loops, used to repeat until a specified condition becomes FALSE
Query loops, used to iterate through database query results
List loops, used to iterate through a specified list
Collection loops, used to loop through structures
File loops, used to loop through the lines in a file
You won’t use all these loop types here, but to acquaint you with <cfloop>, let’s look at a few examples.