MACROMEDIA COLFUSION MX 7-CFML Reference page 476

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

ArrayLen
Description
Determines the number of elements in an array.
Returns
The number of elements in an array.
Category
Array functions
Function syntax
ArrayLen(array)
See also
; "Functions for XML object management" in Chapter 35, "Using XML and
ArrayIsEmpty
WDDX," in ColdFusion MX Developer's Guide
History
ColdFusion MX: Changed behavior: this function can be used on child XML objects.
Parameters
Parameter
array
Example
<h3>ArrayLen Example</h3>
<cfquery name = "GetEmployeeNames" datasource = "cfdocexamples">
SELECT FirstName, LastName FROM Employees
</cfquery>
<!--- create an array --->
<cfset myArray = ArrayNew(1)>
<!--- set element one to show where we are --->
<cfset myArray[1] = "Test Value">
<!--- loop through the query and append these names
successively to the last element --->
<cfloop query = "GetEmployeeNames">
<cfset temp = ArrayAppend(myArray, "#FirstName# #LastName#")>
</cfloop>
<!--- show the resulting array as a list --->
<cfset myList = ArrayToList(myArray, ",")>
<!--- output the array as a list --->
<cfoutput>
<p>The contents of the array are as follows:
<p>#myList#
<p>This array has #ArrayLen(MyArray)# elements.
</cfoutput>
476
Chapter 3: ColdFusion Functions
Description
Name of an array

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents