Adobe COLDFUSION 9 Manual page 98

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Function
Description
ArraySet
Sets the elements in a 1D array in a specified range to a specified value.
Returns the specified array with elements sorted numerically or alphanumerically.
ArraySort
ArraySum
Returns the sum of values in the specified array.
Swaps array values in the specified indexes.
ArraySwap
ArrayToList
Converts the specified 1D array to a list, delimited with the character you specify.
Returns True if the value is an array.
IsArray
ListToArray
Converts the specified list, delimited with the character you specify, to an array.
For more information about each of these functions, see the CFML Reference.
If a function returns an array, you can now reference a specific element array directly in the function call statement.
For example, the following line references the fifth element of the array returned by the myFunc() function:
myFunc()[5]
About structures
ColdFusion structures consist of key-value pairs. Structures let you build a collection of related variables that are
grouped under a single name. You can define ColdFusion structures dynamically.
You can use structures to reference related values as a unit, rather than individually. To maintain employee lists, for
example, you can create a structure that holds personnel information such as name, address, phone number, ID
numbers, and so on. Then you can reference this collection of information as a structure called employee rather than
as a collection of individual variables.
A structure key must be a string. The values associated with the key can be any valid ColdFusion value or object. It can
be a string or integer, or a complex object such as an array or another structure. Because structures can contain any
types of data, they provide a powerful and flexible mechanism for representing complex data.
Structure notation
ColdFusion supports three types of notation for referencing structure contents. The notation that you use depends on
your requirements.
Last updated 8/5/2010
93

Advertisement

Table of Contents
loading

Table of Contents