Chapter 2: ColdFusion Functions
259
ArrayInsertAt
Inserts data in the specified array at the specified index position. All array elements
with indexes greater than the new position are shifted right by one. The length of the
array increases by one index.
Returns a Boolean TRUE on successful completion.
See also
ArrayDeleteAt
.
Syntax
ArrayInsertAt
(
array, position, value)
array
Name of the array in which you want to insert data.
position
The index position in the specified array where you want to insert the data
specified in value.
value
The value of the data you want to insert into the array.
Example
<!--- This example shows ArrayInsertAt --->
<HTML>
<HEAD>
<TITLE>ArrayInsertAt Example</TITLE>
</HEAD>
<BODY>
<H3>ArrayInsertAt 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] = "Thursday">
<!--- add an element before position 3 --->
<P>Add an element before position 3:
<CFOUTPUT>#ArrayInsertAt(DaysArray,3,"Wednesday")#</CFOUTPUT>
<P>Now output the array as a list:
<CFOUTPUT>#ArrayToList(DaysArray)#</CFOUTPUT>
<!--- Notice how the array now has four elements, and that
element 3, "Thursday", has now become element four --->
</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...