Chapter 2: ColdFusion Functions
269
ArraySet
In a one-dimensional array, sets the elements in a specified range to the specified
value. Useful in initializing an array after a call to ArrayNew. Returns a Boolean TRUE
on successful completion.
See also
ArrayNew
.
Syntax
ArraySet
(
array, start_pos, end_pos, value)
array
Name of the array you want to change.
start_pos
Starting position in the specified array.
end_pos
Ending position in the specified array. If this value exceeds the array length,
elements are accordingly added to the array.
value
The value you want to add to the range of elements in the specified array.
Example
<!--- This example shows ArraySet --->
<HTML>
<HEAD>
<TITLE>ArraySet Example</TITLE>
</HEAD>
<BODY>
<H3>ArraySet Example</H3>
<!--- Make an array --->
<CFSET MyNewArray = ArrayNew(1)>
<!--- Note that ArrayToList will not function properly
if the Array has not been initialized with ArraySet --->
<CFSET temp = ArraySet(MyNewArray, 1,6, "Initial Value")>
<!--- set some elements --->
<CFSET MyNewArray[1] = "Sample Value">
<CFSET MyNewArray[3] = "43">
<CFSET MyNewArray[6] = "Another Value">
...
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...