Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

List finding multiple items...possible?

19 views
Skip to first unread message

ultrakit

unread,
Jan 8, 2012, 6:49:35 PM1/8/12
to
I have a question about find items in a list. Let say the list
contains 1,2,3,4,5.

I can easily use listFindNoCase to find 1 but what function can I use
if I want to check if the list contains 1 and 3?

Is there even one or I have to do a loop?

Thanks in advance.

Bob Dively

unread,
Jan 9, 2012, 9:33:08 AM1/9/12
to
ultrakit <ultr...@gmail.com> wrote:
> I have a question about find items in a list. Let say the list
> contains 1,2,3,4,5.

> I can easily use listFindNoCase to find 1 but what function can I use
> if I want to check if the list contains 1 and 3?

Assuming that you're using it as a condition in a CFIF statement,
search for each number individual and use an AND in the CFIF:

<CFSET tmp="1,2,3,4,5" >

<CFIF ListFindNoCase(tmp, "1") GT 0 AND ListFindNoCase(tmp, "3") GT 0>

<!--- do stuff --->

</CFIF>

--
Bob Dively | I used to be indecisive, but now I'm not sure...
0 new messages