Determines whether a value is an array.
True, if value is an array, or a query column object.
Array functions, Decision functions
IsArray(value [, number ])
New in ColdFusion MX: if the value
attribute contains a reference to a query result column, this function returns True. For example: isArray(MyQuery['Column1'])
returns True. (In earlier releases, it returns False.)
New in ColdFusion MX: this function can be used on XML objects.
Parameter | Description |
---|---|
value |
Variable or array name |
number |
Dimension; function tests whether the array has exactly this dimension |
This function evaluates a Java array object, such as vector object, as having one dimension.
<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> <p>Is this an array? #IsArray(MyNewArray)# <p>It has #ArrayLen(MyNewArray)# elements. <p>Contents: #ArrayToList(MyNewArray)# </cfoutput>