Listdeleteat - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

ListDeleteAt

Description
Deletes an element from a list.
Returns
A copy of the list, without the specified element.
Category
List functions
Function syntax
ListDeleteAt(list, position [, delimiters ])
See also
ListGetAt, ListSetAt,
Parameters
Parameter
list
position
delimiters
Usage
To use this and other functions with the default delimiter (comma), you can code as follows:
<cfset temp2 = ListDeleteAt(temp, "3")>
To specify another delimiter, you code as follows:
<cfset temp2 = ListDeleteAt(temp, "3", ";")>
ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.
Example
<!--- First, query to get some values for our list elements--->
<CFQUERY NAME="GetParkInfo" DATASOURCE="cfsnippets">
SELECT PARKNAME,CITY,STATE
FROM Parks
WHERE PARKNAME LIKE 'CHI%'
</CFQUERY>
<CFSET temp = ValueList(GetParkInfo.ParkName)>
<CFSET deleted_element = ListGetAt(temp, "3", ",")>
<cfoutput>
<p>The original list: #temp#
</cfoutput>
<!--- Delete the third element from the list --->
<CFSET temp2 = ListDeleteAt(Temp, "3")>
<cfoutput>
ListLen
Description
A list or a variable that contains one.
A positive integer or a variable that contains one. Position at which to delete
element. The first list position is 1.
A string or a variable that contains one. Character(s) that separate list elements.
Default: comma.
If this parameter contains more than one character, ColdFusion processes each
occurrence of each character as a delimiter.
ListDeleteAt
567

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents