macromedia.coldfusion.advanced_techniques
[Top] [All Lists]

Re: working with Lists

Subject: Re: working with Lists
From: "-==cfSearching==-"
Date: Tue, 3 Mar 2009 20:07:16 +0000 UTC
Newsgroups: macromedia.coldfusion.advanced_techniques

Treat the value as nested lists.  Loop through it using return ( chr(13) and/or 
chr(10) as the row delimiter.  That will split the data into rows.  Then split 
each row into columns using "|" as the delimiter.  

 If you are using CF8, I would recommend using arrays instead of list 
functions. The listToArray(..) function now supports empty elements.  So your 
script will not break if one of the values is omitted.

 <cfloop list="#response#" index="row" delimiters="...">
      <cfset cols = listToArray(row, "|", true)>
      ... do something with the values here ...
 </cfloop> 




<Prev in Thread] Current Thread [Next in Thread>