Listrest - MACROMEDIA COLDFUSION MX 61-CFML Reference

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

Advertisement

ListRest

Description
Gets a list, without its first element.
Returns
A copy of list, without the first element. If list has one element, returns an empty list.
Category
List functions
Function syntax
ListRest(list [, delimiters ])
See also
ListFirst, ListGetAt,
Parameters
Parameter
list
delimiters
Usage
If the list begins with one or more empty entries, this function drops them, as well as the first
element.
ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.
Example
<h3>ListFirst, ListLast, and ListRest Example</h3>
<!--- Find a list of users who wrote messages --->
<cfquery name = "GetMessageUser" datasource = "cfsnippets">
SELECT Username, Subject, Posted
FROM
Messages
</cfquery>
<cfset temp = ValueList(GetMessageUser.Username)>
<p>Before editing the list, it is:&nbsp;
<cfoutput>#ValueList(GetMessageUser.Username)#</cfoutput>.
<p>(Users who posted more than once are listed more than once.)
<p>The first user in the list is:
<cfoutput>#ListFirst(temp)# </cfoutput>
<p>The rest of the list is:&nbsp;<cfoutput>#ListRest(temp)#</cfoutput>.
<p>(Users who posted more than once are listed more than once.)
<p>The last user in the list is: <cfoutput>#ListLast(temp)#</cfoutput>
584
Chapter 3: ColdFusion Functions
ListLast
Description
A list or a variable that contains one.
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.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents