isArray
Description
Determines whether a value is an array.
Categories
History
ColdFusion
MX:
Changed behavior: if the value parameter
contains a reference to a query result column, this function now
returns True. For example: isArray(MyQuery['Column1']) returns
True. (In earlier releases, it returns False.)
Changed behavior: this function can be used on XML objects.
Syntax
IsArray(value [, number ])
Attributes
| Attribute | Description | Required | Default |
|---|---|---|---|
| number | Dimension; function tests whether the array has exactly this dimension | ||
| value | Variable or array name |
Returns
True,
if value is an array, or a query column object.
Usage
Use this function to determine whether a value is an array or query column. This function evaluates a Java array object, such as a vector object, as having one dimension.
Example
<h3>IsArray Example</h3>
<!--- Make an array --->
<cfset MyNewArray = ArrayNew(1)>
<!--- set some elements --->
<cfset MyNewArray[1] = "element one">
<cfset MyNewArray[2] = "element two">
<cfset MyNewArray[3] = "element three">
<!--- is it an array? --->
<cfoutput>
Is this an array? #IsArray(MyNewArray)#
It has #ArrayLen(MyNewArray)# elements.
Contents: #ArrayToList(MyNewArray)#
</cfoutput>