The Index Loop

One of the most frequently used loops is the index loop, used to loop a set number of times (from a specified value to another specified value). To learn about this loop, you’ll generate a simple list (see Figure 9.8). Type the code in Listing 9.11, and save it in 9 as loop1.cfm.

Figure 9.8. Loops can build lists and other display elements automatically.
Listing 9.11. loop1.cfm
<!--- Name: loop1.cfm Author: Ben Forta (ben@forta.com) Description: Demonstrate use of <cfloop from to> Created: 07/01/2007 ---> <html> <head> <title>Loop 1</title> </head> <body> <!--- Start list ---> <ul> <!--- loop from 1 to 10 ...

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.