• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. Complex Datatypes > 6.1. Lists

Lists

A list is a special type of string that contains delimited elements. For example, “a,b,c,d,e,f,g” is a list where “a”, “b”, “c”, “d”, “e”, “f”, and “g” are considered the list elements while the comma (,) is considered the delimiter. Lists are commonly used to store related items in a single variable. For example, you might use a list to store all the primary key values for a group of database records you want to delete.

It should be noted that ColdFusion treats list elements containing null values as though they don’t exist. For example, the list “1,2,,4” contains only three list elements (as far as ColdFusion is concerned) even though there is a null list element “,,”. The concept of a null list element shouldn’t be confused with a blank list element as in “1,2, ,4”, which contains four list elements, the space occupying list element three being counted. To further illustrate the point, consider


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint