MACROMEDIA COLFUSION MX 7-CFML Reference page 725

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

ListInsertAt
Description
Inserts an element in a list.
Returns
A copy of the list
Category
List functions
Function syntax
ListInsertAt(list, position, value [, delimiters ])
See also
,
ListDeleteAt
ColdFusion Variables," in ColdFusion MX Developer's Guide
Parameters
Parameter
list
position
value
delimiters
Usage
When inserting an element, ColdFusion inserts a delimiter. If
one delimiter, ColdFusion uses the first delimiter in the string; if
ColdFusion uses a comma.
ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.
Example
<!--- This example shows ListInsertAt --->
<cfquery name = "GetParkInfo" datasource = "cfdocexamples">
SELECT PARKNAME,CITY,STATE
FROM PARKS
WHERE PARKNAME LIKE 'DE%'
</cfquery>
<cfset temp = ValueList(GetParkInfo.ParkName)>
<cfset insert_at_this_element = ListGetAt(temp, "3", ",")>
<cfoutput>
<p>The original list: #temp#
</cfoutput>
<cfset temp2 = ListInsertAt(Temp, "3", "my Inserted Value")>
with value inserted at the specified position.
,
,
ListAppend
ListPrepend
Description
A list or a variable that contains one.
A positive integer or a variable that contains one. Position at which to insert
element. The first list position is 1.
An element or a list of elements.
A string or a variable that contains one. Character(s) that separate list elements.
The default value is comma.
If this parameter contains more than one character, ColdFusion processes each
occurrence of each character as a delimiter.
,
; "Lists" in Chapter 3, "Using
ListSetAt
delimiters
delimiters
contains more than
is omitted,
ListInsertAt
725

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents