Description

Determines whether a value is an array.

Returns

True, if value is an array, or a query column object.

Category

Array functionsDecision functions

Function syntax

IsArray(object [, number ])

See also

Array functionsModifying a ColdFusion XML object in the Developing ColdFusion Applications

History

ColdFusion (2018 release): Introduced named parameters.

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.

Parameters

Parameter

Description

object

Variable or array name

number

Dimension; function tests whether the array has exactly this dimension

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

<cfscript>
    // Make an array
    MyNewArray = ArrayNew(1)
    // set some elements
    MyNewArray[1] = "element one"
    MyNewArray[2] = "element two"
    MyNewArray[3] = "element three"
    // is it an array?
    writeOutput(IsArray(MyNewArray)) // Returns True
</cfscript>

Output

YES

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy