On 2/16/02, Steve Oliver penned:
>That's how CF handles lists.
>
>If you do a listlen(list) it will return 6 in your case.
>
>1,2,3,,4,5 is treated as 5 elements

Yes, and I HATE that. LOL

Neil, I presume you're doing your authorizenet thing and using 
cfhttp. In the setting in the authnet console you can set a delimiter 
and an encapsulation character, or you can pass it as part of your 
code. I use a pipe and a quote.

<cfhttpparam type="FORMFIELD" name="x_ADC_Delim_Data" value="TRUE">
<cfhttpparam type="FORMFIELD" name="x_ADC_Delim_Character" value="|">
<cfhttpparam type="FORMFIELD" name="x_ADC_Encapsulate_Character" value="%22">

This will delimit the list with pipes. Don't want to use a comma 
since  you'll get a Company, Inc. or a Smith, Jr. which will screw up 
your list. It will also encapsulate the fields with quotes, making 
your list return the correct number of items.

"1"|"1"|"1"|"This transaction has been approved."|""|"P"|"34234234"

Then you grab each list item and strip out the quotes.

<cfset product.response_code = Replace(ListGetAt(CFHTTP.FileContent, 
1, "|"),'"','','ALL')>
<cfset product.response_code = Replace(ListGetAt(CFHTTP.FileContent, 
2, "|"),'"','','ALL')>
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
______________________________________________________________________
Why Share?
  Dedicated Win 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=coldfusionc
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