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

Re: ListFind and ListContains

Subject: Re: ListFind and ListContains
From: Ian Skinner
Date: Wed, 17 Sep 2008 06:41:44 -0700
Newsgroups: macromedia.coldfusion.cfml_general_discussion


Olivia Crazy Horse wrote:
I did check the livedocs but did not understand, that is why I was asking if it actually will find the desired value inside a list, or only returns true (gt 0), as Dan's example show.
 I also tried that, gt 0, and it still does not give me what I want.

If my list contains, "Error, Mistake, Other (No Reason), Whatever", and I want to see if the list contains "Other (No Reason), the list find only works if the Other...is the only one in the list. If it is embedded with the others, the listfind does not seem to work, that is, it does not cfoutput the display.


ListFind() matches the entire list element so 'Other' and 'Other (No Reason)' are different values. You probably want listContains() which will match partial list elements. Or maybe just a straight up string find() function.


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