The List Loop

List loops are designed to make working with ColdFusion lists simple and error-free. Whether it is lists created by form submissions, manual lists, lists derived from database queries (regardless of the origin), any list (with any delimiter) can be iterated over using <cfloop>.

For an introduction to lists, see Chapter 8.

The following example uses a list created in Chapter 8 and loops through the list displaying one element at a time (see Figure 9.9). Save Listing 9.12 as loop2.cfm.

Figure 9.9. Any lists, with any delimiter, can be iterated using <cfloop>.
Listing 9.12. loop2.cfm
<!--- Name: loop2.cfm Author: ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started 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.