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

Using ColdFusion Arrays

Arrays are another way that you can store multiple values in one variable, but arrays are structurally very different from lists. You learned in the previous section that lists are simply strings with a delimited structure and that the items in a list are all stored within the same string, though at different positions. Arrays are memory constructs that use indexes to specify the location of one of the elements stored inside them. The indexes are numerical values that act like addresses that enable you to know where a particular piece of data lives in the array.

Arrays are also different in that you have much more flexibility in what you can store in them. List items are, by necessity, string values because the whole list is itself a string. You can store many other types of information in an array, including date/time variables, query objects, structures (discussed in the next section), and even other arrays.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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