Thanks.
By the time I got this email I just edited the listcompare UDF at cflib.org.


At 11:43 AM 5/21/2002 -0700, you wrote:
>I build a UDF to do just that
>
><cfscript>
>function compareLists(listIn,listToCheck) {
>         delim = ","; // Default
>         if (ArrayLen(arguments) GT 2) { delim = arguments[3]; }
>         listIn = delim & listin & delim;
>         regExp = delim & ReplaceNoCase(listToCheck, delim, delim & "|" &
>delim, "ALL") & delim;
>         return REFindNoCase(regExp, listIn);
>}
></cfscript>
>
>Works like a charm :) HTH
>
><cfset listA = "1,2,3">
><cfset listB = "2,7,5">
><cfif compareLists(listA,listB)>
>..
></cfif>
>
>Note that you can optionally specify the delimeter:
>
><cfset listA = "1$2$3">
><cfset listB = "2$7$5">
><cfif compareLists(listA,listB,"$")>
>..
></cfif>
>
>Enjoy!
>
>--
>Scott Van Vliet
>Sempra Energy
>555 W. 5th St., 21st Floor
>Los Angeles, CA 90013
>Tel > 213.244.5205
>Email > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
>
>"Hello Stupid, and welcome to your crappy computer."
>- Strong Bad, HomestarRunner.com
>
>
>
>
>
>
> > -----Original Message-----
> > From: Won Lee [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, May 21, 2002 10:57 AM
> > To: CF-Talk
> > Subject: Most efficient way to check if two lists
> >
> >
> > Hello,
> >
> > Need to find out which way is the most efficient way to see
> > if a value in
> > list A is a value in list B.
> >
> > List A = 1,2,3                VALID ListMatch
> > List B = 2,3,4
> >
> > List A = 1,2,3                VALID ListMatch
> > List B = 1,4,6
> >
> > List A = 1,2,3                NOT VALID ListMatch
> > List B = 7,4,6
> >
> >
> > As long as it has single matching values it is valid.
> >
> >
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to