Category Archive for: Working with cold Fusion Data Structure

Accessing Structures Using Associatlve Arr Syntax

The associative-array syntax for accessing elements in a structure is designed. to r the syntax used to access elements of standard arrays. This syntax uses square brae around the index or key. Therefore in our social security number structure you c assign a key-value pair to the structure with the following <CFSET SSN[‘123-45-6789’] – ‘Joe Smith’> In fact,…

Read More →

Understanding and Using Structures and Associative Arrays

ColdFusion offers another complex data structure: structures. Some developers, including those familiar with JavaScript, will know structures as associative arrays. Where standard arrays were used to create a numerically indexed group of elements, associative arrays create key-value pairs. That is, they associate one value with another where neither the key nor the value needs to be an arbitrary numeric…

Read More →

ArrayClear

The ArrayCl ear function deletes all elements in an array. That is, it actually removes all elements from the array (as opposed to assigning some default value such as the empty string or zero). The result is a string oflength zero in all dimensions. The function takes a single argument: ArrayCl ear(Array). A Boolean value of True is…

Read More →

Understanding Dynamic Array Sizes

The capability of ColdFusion arrays to change size dynamically has some implications that need to be understood. The essential issue is this: An array is a continuous series of elements With the first index being 1 and no gaps in the series of element indexes. What does this mean? First, an array with the following elements (and…

Read More →

Putting It All Together

Now that you have a firm grasp of all the functions related to a list, let’s look at a small example of how to use these capabilities in an application. For example, say a list of comma-delimited e-mail addresses has been provided by a user (don’t concern yourself with how the list is provided because this is…

Read More →

List Append

Up to this point, you’ve looked at functions that enable you to obtain information about a list and its elements. Li stAppend performs a different role: It alters the contents of a list. Specifically List Append adds an element to the end of the list using the form ListAppendCL i st Element Delimiters). The delimiter argument is optional…

Read More →

Working with cold Fusion Data Structure

So far in the book, you have worked with simple data types: numbers strings Boolean values and the like. ColdFusion however supports a collection of more advanced data types common to most programming languages. In ColdFusion these more sophisticated data types are lists arrays and structures. In all cases these data types combine collections of simpler data types into…

Read More →

Back to Top