ListCOntains returns the index, not the # of matches.

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Mark M. Kecko [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, March 05, 2002 12:32 PM
> To: CF-Talk
> Subject: ListContains NOT functioning properly - Help!
> 
> 
> Help!
> 
> When I'm looping over a list Campaign.Vehicles that's coming 
> from a SQL
> table varchar field I'm getting strange results from ListContains.
> 
> Looping over Vehicles.code=
> "siteMinute,siteNews,site,siteSpin,mi,os,ol,mn,siteHome" - 
> several rows from
> a database call.
> 
> Campaign.Vehicles="siteMinute,siteNews,site,siteSpin" - a 
> 'static' database
> record.
> 
> When Vehicles.code = "SiteSpin" the below
> "ListContains("#Campaign.Vehicles#", "#Vehicles.Code#")" returns 4.
> 
> <cfloop query="Vehicles">
>       <input class=text type="checkbox" name="#Vehicles.Code#"
>       <cfif ListContains("#Campaign.Vehicles#",
> "#Vehicles.Code#")>checked</cfif>>
>       &nbsp;#Vehicles.Name#<br><br>
> </cfloop>
> 
> Actual output to screen from testing:
> Campaign.Vehicles: siteMinute,siteNews,site,siteSpin
> Vehicles.Code: siteSpin
> ListContains - 4
> 
> As far as I can see from the output above siteSpin is only in the list
> Campaign.Vehicles once.  Can anybody see something I can't.  
> I've tried
> specifying the delimiter as a comma, changing the delimiter 
> to a ~, setting
> the database field to a variable, changing the delimiters of 
> that variable
> and I've tried all of those things with ListContainsNoCase as 
> well. I've
> even tried changing the datatype of my SQL database field to 
> nvarchar, ntext
> etc! Please help, this is holding up a very profitable ad 
> campaign from
> being served on my site!
> 
> Mark Kecko
> The Computer Guy
> MediaPost Communications
> [EMAIL PROTECTED]
> http://www.mediapost.com
> (203)222-0330 ext309
> 
> "Imagination is the one weapon in the war against reality."
> Jules de Gaultier
> 
> 
> 
> 
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
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