Contents > Developing ColdFusion MX Applications > Using Arrays and Structures > About arrays > Basic array concepts PreviousNext

Basic array concepts

The following terms will help you understand subsequent discussions of ColdFusion arrays:

The simplest array is a one-dimensional array, similar to a row in a table. A one-dimensional array has a name (the variable name) and a numerical index. The index number references a single entry, or cell, in the array, as the following figure shows:

Thus, the following statement sets the value of the fifth entry in the one-dimensional array MyArray to "Robert":

<cfset MyArray[5] = "Robert">

A basic two-dimensional (2D) array is like a simple table. A three-dimensional (3D) array is like a cube of data, and so on. ColdFusion lets you directly create arrays with up to three dimensions. You can use multiple statements to create arrays with more than three dimensions.

The syntax my2darray[1][3]="Paul" is the same as saying 'My2dArray is a two-dimensional array and the value of the array element index [1][3] is "Paul"'.


Contents > Developing ColdFusion MX Applications > Using Arrays and Structures > About arrays > Basic array concepts PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/arrayst3.htm