View comments | RSS feed

ArrayClear

Description

Deletes the data in an array.

Return value

True, on successful completion.

Category

Array functions

Syntax

ArrayClear(array)

See also

ArrayDeleteAt

History

New in ColdFusion MX: this function can be used on XML objects.

Parameters

Parameter Description
array
Name of an array

Example

<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>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


No screen name said on Apr 21, 2004 at 11:02 AM :
i'm guessing temp is a temporary variable...
halL said on Apr 21, 2004 at 11:31 AM :
Temp is a temorary variable, and is not required if you don't want to get a success/failure indicator back. You could also use <cfset ArrayClear(MyArray)>.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt16.htm