Lists

Lists are used to group together related information. Lists are actually strings (plain text)—what makes them lists is that a delimiter is used to separate items within the string. For example, the following is a comma-delimited list of five U.S. states:

California,Florida,Michigan,Massachusetts,New York

The next example is also a list. Even though it might not look like a list, a sentence is a list delimited by spaces:

This is a ColdFusion list

Lists are created just like any other variables. For example, this next line of code uses the <cfset> tag to create a variable named fruit that contains a list of six fruits:

<cfset fruit="apple,banana,cherry,grape,mango,orange">

The code in Listing 8.7 demonstrates the use of lists. Type the code ...

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.