If I understand you - you would like to see if a value is in a list - right
?
<cfset myNbrToFind = "2" >
<cfset myListToSearch = "2,3,4,5,6,52" >
<cfif ListFind(myListToSearch,myNbrToFind, ",")>
<!--- do something cool if I find it ... and return the element position--->
<cfelse>
<!--- do nothing because it was not in my list --->
</cfif>
would work for you.
Chris
Christopher Conrad
Victoria's Secret Catalogue
http://www.VictoriasSecret.com
Senior.Programmer.Analyst
614.337.5653
[EMAIL PROTECTED]
> -----Original Message-----
> From: Gilles Ratte [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, July 07, 2000 10:52 AM
> To: 'cftalk'
> Subject: contained in a list
>
> I need know if a number is one of a list item.
>
> let me explain
>
> let's say.. mynumber = 2 ans mylist = 2,67,34,52
>
>
> I thought this would do ..
> <cfif #listcontains(mylist, mynumber)# is 0>
> ...
> <cfelse>
> ...
> </cfif>
>
> but it does not act like I want ... It compare the same whay as of strings
> and will find 2 and 52
>
> What I want to do is to get the exact item in the list
>
>
> Someone has an idea on how to do it?
>
> Thanks
> --------------------------------------------------------------------------
> ----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.