At 01:06 AM 11/3/2001, you wrote:
>So, I say to him,  if want to put commans in there, you have to quote the
>text.
>Ex: "wide","very, deep","too easy","rugby"
>OR 'wide','very, deep','too easy','rugby'
>
>Well, this didn't work.  CF ignors the quotes and treats all commas it finds
>as delimiters
>
>Any ideas how I can allow a comma in the list?

Hmm this is a tricky one.  Firstly, do you really have to have it 
comma-delimited, CF can use any character as a delimiter in it's list 
functions (and in <CFLOOP> when running over a list).

If you really have to use comma delimiters, my suggestion would be to do 
something like...

         <CFSET fancyList = 'wide,"very, deep",too easy,rugby'>

         <CFSET fancyList = ReReplace(fancyList, '"([^"]*),([^"]*)"', 
"\1#CHR(7)#\2", "ALL")>

         <CFLOOP LIST="#fancyList#" INDEX="item">

                 <CFSET realItem = Replace(item, CHR(7), ",", "ALL")>

                 <!--- Do what you want with realItem here --->

         </CFLOOP>

I haven't tested that, not sure if CHR(7) is a very good character (my 
ASCII table has gone walkabout right at the moment) to use.  Essentially we 
take the non-delimiter commas and before we loop over the list we convert 
them into some non-printable character that won't mess our processing up 
(dropping the quotes around that item at the same time).  Then in the loop 
we switch the non-printable character back into a comma to get the actual 
list item.



----------
James Sleeman
Innovative Media Ltd
Phone: (03) 377 6262
http://www.websolutions.co.nz/

CAUTION: The information contained in this email message is confidential 
and may be legally privileged. If the reader of this message is not the 
intended recipient you are notified that any use, dissemination, 
distribution or reproduction of this message is prohibited. If you have 
received this message in error please notify the sender immediately and 
destroy the original message and any attachments.

Views expressed in this communication may not be those of Innovative Media 
Ltd.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
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