ArrayClear

Description

Deletes all data in an array. Returns a Boolean TRUE on successful completion.

Category

Array functions

Syntax

ArrayClear(array) 

See also

ArrayDeleteAt

Parameters

Parameter
Description
array
Name of an array from which to delete data

Example

<!--- This example shows ArrayClear --->
<html>
<head>
<title>ArrayClear Example</title>
</head>

<body>
<H3>ArrayClear 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>