Chapter 2: ColdFusion Functions
ListValueCount
Returns the number of instances of a specified value in a list. The underlying search
that finds the instances is case-sensitive.
See also ListValueCountNoCase.
Syntax
ListValueCount( list, value [, delimiters ])
list
A list or the name of a list that is to be searched.
value
The string or number that the function is to find and count.
delimiter
Optional. Specify the character(s) used to delimit elements in the list. The default
is a comma ( , ).
Example
<!--- This example uses ListValueCount to see how many
employees are in a department --->
<HTML>
<HEAD>
<TITLE>ListValueCount Example</TITLE>
</HEAD>
<body
<CFQUERY NAME="SearchByDepartment" DATASOURCE="cfsnippets">
SELECT Department
FROM Employees
</CFQUERY>
<H3>ListValueCount Example</H3>
<P>This example uses ListValueCount to see how many employees
are in a department.
<FORM ACTION="listvaluecount.cfm" METHOD="POST">
<P>Select a department:</P>
<select NAME="departmentName">
bgcolor="#FFFFD5">
<option VALUE="Accounting">
Accounting
</OPTION>
<option VALUE="Administration">
Administration
</OPTION>
<option VALUE="Engineering">
Engineering
</OPTION>
<option VALUE="Sales">
Sales
431
Need help?
Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?
Questions and answers