Data Structures

This category talks about different kinds of data structures, or forms of data. It includes questions about lists, arrays, and structures not covered in other categories.

Problems

How do I create an array with more than three dimensions?
ColdFusion lets you directly create arrays with up to three dimensions using the arrayNew() function...

How do I find a value in a list?
ColdFusion provides four functions that can help you find a value in a list. The first two are relat...

How do I find a value in an array?
ColdFusion does not provide a built-in way to search an array for values. However, you have a few op...

How do I sort a 2 dimensional array?
ColdFusion does not provide a built-in way to sort a multi-dimensional array. However, there 2 ways...

How do I sort a single dimension array?
Use the built in ColdFusion arraySort() function. ...

How do I sort a structure?
Use the built in ColdFusion structSort() function. StructSort() returns an array of top-level...

How do you copy a structure?
There are (at least) 3 ways to copy a structure. Assume an existing structure named myStruct. 1) ...

How do you determine if an array position exists?
ColdFusion does not have any built in function to determine if an array position is defined. The sim...

How do you dynamically set a variable and its value?
You need to set a value to a variable but the name of the variable is also to be set dynamically, fo...

How do you loop over the values in a structure?
A structure is a complex object that is comprised of key-value pairs. Let's say we have a struc...

How do you loop over the values of an array?
An array is a collection of data indexed by numbers. So for an example, an array of values may have ...

How do you return the value of a dynamic structure key?
If you need to return the value of a structure key where the key is dynamic, you must use bracket no...