macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: ListFind and ListContains

Subject: Re: ListFind and ListContains
From: "-==cfSearching==-"
Date: Wed, 17 Sep 2008 01:53:03 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion

Olivia Crazy Horse wrote:
 > No, it does not have a syntax error.

 The example you posted does. It is missing a closing # sign.  But from what 
you described, I assume that is just a typo.

 > Does ListFind and/or ListContains actually find/search the variable for the 
desired output, 
 > or does it just find the first position and return true ?

 The documentation is the best resource for how the different functions operate:
 http://livedocs.adobe.com/coldfusion/7/htmldocs/00000552.htm
 [i]Returns: Index of the first list element that contains value, with matching 
case. If not found, returns zero. The search is case-sensitive.[/i]

 > But I do not get the cfoutput display, and I know that [b]Other[/b] is in 
the list. 

 ListFind is performs case sensitive search.  So if your list contains "Other", 
then searching for "other" (lowercase) will not find a match.  To ignore case, 
use ListFindNoCase instead.

 Other things to be aware of are that any spaces in between the list elements 
can result in a failure to find a match. It is because the spaces are treated 
as part of the list element value.   


<Prev in Thread] Current Thread [Next in Thread>