258
CFML Language Reference
ArrayDeleteAt
Deletes data from the specified array at the specified index position. Note that when an
array index is deleted, index positions in the array are recalculated. For example, in an
array containing the months of the year, deleting index position [5] removes the entry
for May. If you then want to delete the entry for November, you delete index position
[10], not [11], since the index positions were recalculated after index position [5] was
removed.
Returns a Boolean TRUE on successful completion.
See also
ArrayInsertAt
.
Syntax
ArrayDeleteAt
(
array, position)
array
Name of the array in which you want to delete index data specified in position.
position
Array position containing the data you want to delete.
Example
<!--- This example shows ArrayDeleteAt --->
<HTML>
<HEAD>
<TITLE>ArrayDeleteAt Example</TITLE>
</HEAD>
<BODY>
<H3>ArrayDeleteAt Example</H3>
<P>
<!--- create a new array --->
<CFSET DaysArray = ArrayNew(1)>
<!--- populate an element or two --->
<CFSET DaysArray[1] = "Monday">
<CFSET DaysArray[2] = "Tuesday">
<CFSET DaysArray[3] = "Wednesday">
<!--- delete the second element --->
<P>Is the second element gone?:
<CFOUTPUT>#ArrayDeleteAt(DaysArray,2)#</CFOUTPUT>
<!--- note that the formerly form third element, "Wednesday"
is now the second element --->
<P>The second element is now: <CFOUTPUT>#DaysArray[2]#</CFOUTPUT>
</BODY>
</HTML>
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...