change your delimiter.

<cfloop index="ListOfURLs" list= "#URL1#||#URL2#" delimiter="||">

that should solve the problem. (it's off the top of my head, so could be a
little wrong).

Shawn Grover


-----Original Message-----
From: Tim Claremont [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 2:25 PM
To: CF-Talk
Subject: CFLOOP problem with commas


I am trying to CFLOOP through a collection of URLs. The problem comes
from the fact that there are commas in some of the URLs. To illustrate
the problem, my code is as follows:

<CFSET URL1=
"http://www.foobar.com/selector/en/prodselect.asp?Xcntry=USA&Xlang=en_US
&error=novars">

<CFSET URL2=
"http://www.foobar.com/SRVS/CGI-BIN/WEBCGI.EXE?New,Kb=x_main_en,Company=
{7C4ED4E1-1DE9-46A0-BC3E-BE1C2FA9E9C9},varset=Xlang:en_US,varset=Xcntry:
USA,varset=prodID:DC220DC">

<cfloop index="ListOfURLs" list= "#URL1#, #URL2#">
        <cfoutput>
                #ListofUrls#
        </cfoutput>
<hr>
</cfloop>


THIS OUTPUTS THE FOLLOWING:

http://www.foobar.com/selector/en/prodselect.asp?Xcntry=USA&Xlang=en_US&;
error=novars
------------------------------------------------------------------------
--------
 http://www.foobar.com/SRVS/CGI-BIN/WEBCGI.EXE?New
------------------------------------------------------------------------
--------
Kb=x_main_en
------------------------------------------------------------------------
--------
Company={7C4ED4E1-1DE9-46A0-BC3E-BE1C2FA9E9C9}
------------------------------------------------------------------------
--------
varset=Xlang:en_US
------------------------------------------------------------------------
--------
varset=Xcntry:USA
------------------------------------------------------------------------
--------
varset=prodID:DC220DC
------------------------------------------------------------------------
--------


As you can see, the first URL outputs normally, but the second URL
breaks at every comma. Is there a way around this? I don't want to
insert Chr() codes if I can help it!



______________________________________________________________________
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to