ListDeleteAt

Returns list with element deleted at the specified position.

See also ListGetAt, ListSetAt, and ListLen.

Syntax

ListDeleteAt(list, position [, delimiters ])
list

Any list.

position

Positive integer indicating the position of the element being deleted. The starting position in a list is denoted by the number 1, not 0.

delimiters

Set of delimiters used in list.

Examples

<!--- This example shows ListDeleteAt --->
<HTML>
<HEAD>
<TITLE>ListDeleteAt Example</TITLE>
</HEAD>

<BASEFONT FACE="Arial, Helvetica" SIZE=2>
<BODY  bgcolor="#FFFFD5">
<H3>ListDeleteAt Example</H3>

<!--- First, query to get some values for our list --->
<CFQUERY NAME="GetEmployees" DATASOURCE="HRApp">
SELECT    LastName, FirstName
FROM Employees
</CFQUERY>

<CFSET temp = ValueList(GetEmployees.LastName)>
<CFSET deleted_item = ListGetAt(temp, "3", ",")>
<CFOUTPUT>
<P>The original list: #temp#
</CFOUTPUT>
<!--- now, delete the third item from the list --->
<CFSET temp2 = ListDeleteAt(Temp, "3", ",")>
<CFOUTPUT>
<P>The changed list: #temp2#
<BR><I>Note that <B>#deleted_item#</B> is no longer present
at position three of the list.</I>
</CFOUTPUT>

</BODY>
</HTML>