This will not always work, you need to use ListFind (or ListFindNoCase)
instead of ListContains. Otherwise "2,9,7" and "2,7,99" will return
true.

Also, put a <cfbreak> in the loop if it is not a match.

Pascal

> -----Original Message-----
> From: cfhelp [mailto:[EMAIL PROTECTED]
> Sent: maandag 15 maart 2004 2:43
> To: CF-Talk
> Subject: RE: Compare List
>
> Worked Perfect!
>  
> Thanks
>  
> Rick
>  
> -----Original Message-----
> From: Greg Luce [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 14, 2004 1:40 PM
> To: CF-Talk
> Subject: RE: Compare List
>  
> You're looking for a match where both lists contain the same
> values, but possibly in different orders right? I would try:
>
> <cfset state_list = "1,2,3,4,5,6,7,8">
> <cfset query_list = "9,8,7,6,5,4,3,2">
>
> <cfif listlen(state_list) EQ listlen(query_list)>
>   <cfloop index="i" list="#state_list#">
>     <cfif NOT listcontains(query_list, i)>
>       Not A Complete Match<cfabort>
>     </cfif>
>   </cfloop>
>   Lists Match
> <cfelse>
>   Not Same Length Match
> </cfif>
>
> Greg
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to