Determines whether an array is empty of data.
Returns a Boolean TRUE if the array is empty; otherwise FALSE.
ArrayIsEmpty(array)
Parameter |
Description |
---|---|
array |
Name of an array to check for data |
<!--- This example shows ArrayIsEmpty ---> <html> <head> <title>ArrayIsEmpty Example</title> </head> <body> <H3>ArrayIsEmpty Example</H3> <!--- create a new array ---> <cfset MyArray = ArrayNew(1)> <!--- populate an element or two ---> <cfset MyArray[1] = "Test"> <cfset MyArray[2] = "Other Test"> <!--- output the contents of the array ---> <P>Your array contents are: <cfoutput>#ArrayToList(MyArray)#</cfoutput> <!--- check if the array is empty ---> <P>Is the array empty?: <cfoutput>#ArrayIsEmpty(MyArray)#</cfoutput> <P>Now, clear the array: <!--- now clear the array ---> <cfset Temp = ArrayClear(MyArray)> <!--- check if the array is empty ---> <P>Is the array empty?: <cfoutput>#ArrayIsEmpty(MyArray)#</cfoutput> </body> </html>