MACROMEDIA COLFUSION MX 7-CFML Reference page 719

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

Advertisement

<cfquery name="SearchEmpLastName" datasource="cfdocexamples">
SELECT
FirstName, RTrim(LastName) AS LName, Phone, Department
FROM
Employees
</cfquery>
<cfset myList = ValueList(SearchEmpLastName.LName)>
<!--- Is this case-sensitive or case-insensitive searching --->
<cfif form.type is "ListFind">
<cfset temp = ListFind(myList, form.myString)>
<cfif temp is 0>
<h3>An employee with that exact last name was not found</h3>
<cfelse>
<cfoutput>
<p>Employee #ListGetAt(ValueList(SearchEmpLastName.FirstName), temp)#
#ListGetAt(ValueList(SearchEmpLastName.LName), temp)#, of the
#ListGetAt(ValueList(SearchEmpLastName.Department), temp)# Department,
can be reached at #ListGetAt(ValueList(SearchEmpLastName.Phone),
temp)#.
<p>This was the first employee found under this case-sensitive last name
search.
</cfoutput>
</cfif>
<cfelse>
<cfset temp = ListFindNoCase(myList, form.myString)>
<cfif temp is 0>
<h3>An employee with that exact last name was not found</h3>
<cfelse>
<cfoutput>
<p>Employee #ListGetAt(ValueList(SearchEmpLastName.FirstName), temp)#
#ListGetAt(ValueList(SearchEmpLastName.LName), temp)#, of the
#ListGetAt(ValueList(SearchEmpLastName.Department), temp)#
Department, can be reached at
#ListGetAt(ValueList(SearchEmpLastName.Phone), temp)#.
<p>This was the first employee found under this case-insensitive last
name search.
</cfoutput>
</cfif>
</cfif>
</cfif>
ListFind
719

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents