Skip to Content
Programming ColdFusion
book

Programming ColdFusion

by Rob Brooks-Bilson
August 2001
Intermediate to advanced
976 pages
38h 8m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion

Arrays

An array is an object that stores indexed values. Each value stored in an array is referred to as an element of the array. Each element has an integer assigned to it that marks its position within the array. This number is referred to as the element’s index. Arrays elements can store any ColdFusion datatype including additional arrays.

As previously discussed, ColdFusion supports one-dimensional (think of this as a single column of data or a list), two-dimensional (think of this as a spreadsheet with rows and columns), and three-dimensional arrays (think of this as a cube of data). Additional dimensions can be created dynamically by nesting multidimensional arrays (creating an array of arrays). ColdFusion arrays differ slightly from traditional arrays found in other programming languages. Whereas traditional arrays are fixed in size, ColdFusion arrays are dynamic. This means that a ColdFusion array can expand or contract as elements are added and removed from the array.

Arrays can store groups of related data such as the contents of a visitor’s shopping cart, student test scores, or historic stock prices. Because array elements can store any ColdFusion datatype, they are ideal for storing complex objects such as an array of query result sets or an array of structures.

Initializing an Array

Initializing an array in ColdFusion is accomplished using the ArrayNew( ) function. This function takes a single argument that determines the number of dimensions for the array (1, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Programming ColdFusion MX, 2nd Edition

Programming ColdFusion MX, 2nd Edition

Rob Brooks-Bilson

Publisher Resources

ISBN: 1565926986Catalog PageErrata