<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ListToArray in ColdFusion 8</title>
	<atom:link href="http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/</link>
	<description>My Views on ColdFusion, Java and related technologies</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:41:45 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Fred M.</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-1106</link>
		<dc:creator>Fred M.</dc:creator>
		<pubDate>Fri, 16 Sep 2011 05:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-1106</guid>
		<description>&quot;There won’t be a CF9! 
Everyone will die soon! &quot;

Everyone should be dead already then. Haha! JK!</description>
		<content:encoded><![CDATA[<p>&#8220;There won’t be a CF9!<br />
Everyone will die soon! &#8221;</p>
<p>Everyone should be dead already then. Haha! JK!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Mollerus</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-218</link>
		<dc:creator>Tom Mollerus</dc:creator>
		<pubDate>Wed, 12 Mar 2008 17:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-218</guid>
		<description>@Hal, aren&#039;t you using the syntax to create a structure?  That may be why your loop isn&#039;t working.</description>
		<content:encoded><![CDATA[<p>@Hal, aren&#8217;t you using the syntax to create a structure?  That may be why your loop isn&#8217;t working.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-217</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Thu, 09 Aug 2007 07:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-217</guid>
		<description>Hal,&lt;br/&gt;I didn&#039;t really understand what breaks. &lt;br/&gt;New syntax for array does not even allow you to have empty elements in array.&lt;br/&gt;So the following code will not run..&lt;br/&gt;&lt;cfset a = [2,4, ,5] /&gt;&lt;br/&gt;&lt;cfloop array=&quot;#a#&quot; index=&quot;anElement&quot;&gt;&lt;br/&gt;&lt;cfoutput&gt;#anElement#&lt;/cfoutput&gt;&lt;br/&gt;&lt;/cfloop&gt;</description>
		<content:encoded><![CDATA[<p>Hal,<br />I didn&#8217;t really understand what breaks. <br />New syntax for array does not even allow you to have empty elements in array.<br />So the following code will not run..<br />&lt;cfset a = [2,4, ,5] /&gt;<br />&lt;cfloop array=&#8221;#a#&#8221; index=&#8221;anElement&#8221;&gt;<br />&lt;cfoutput&gt;#anElement#&lt;/cfoutput&gt;<br />&lt;/cfloop&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: halhelms</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-216</link>
		<dc:creator>halhelms</dc:creator>
		<pubDate>Wed, 08 Aug 2007 22:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-216</guid>
		<description>Rupesh,&lt;br/&gt;&lt;br/&gt;Unfortunately, if you use the new syntax for CF, the empty elements are not ignored when looping over the list.&lt;br/&gt;&lt;br/&gt;&lt;cfset a = {2,,4,5} /&gt;&lt;br/&gt;&lt;cfloop array=&quot;#a&quot; index=&quot;anElement&quot;&gt;&lt;br/&gt;   #anElement#&lt;br/&gt;&lt;cfloop&gt;&lt;br/&gt;&lt;br/&gt;This will break</description>
		<content:encoded><![CDATA[<p>Rupesh,</p>
<p>Unfortunately, if you use the new syntax for CF, the empty elements are not ignored when looping over the list.</p>
<p>&lt;cfset a = {2,,4,5} /><br />&lt;cfloop array=&#8221;#a&#8221; index=&#8221;anElement&#8221;><br />   #anElement#<br />&lt;cfloop></p>
<p>This will break</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-215</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Mon, 06 Aug 2007 11:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-215</guid>
		<description>Giancarlo,&lt;br/&gt;In ColdFusion ListToArray function, when you specify multi-character delimiter, each character is treated as a separate delimiter and not the whole string. This behavior exists since ListToArray function was introduced. So when you had a delimiter &#039;&quot;,&quot;&#039;,  it treated &#039;&quot;&#039; and &#039;,&#039; as separate delimiters and hence 24 elements. If you want to have a multi-character delimiter, as in your example, you should use the UDF List2Array I had mentioned.</description>
		<content:encoded><![CDATA[<p>Giancarlo,<br />In ColdFusion ListToArray function, when you specify multi-character delimiter, each character is treated as a separate delimiter and not the whole string. This behavior exists since ListToArray function was introduced. So when you had a delimiter &#8216;&#8221;,&#8221;&#8216;,  it treated &#8216;&#8221;&#8216; and &#8216;,&#8217; as separate delimiters and hence 24 elements. If you want to have a multi-character delimiter, as in your example, you should use the UDF List2Array I had mentioned.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giancarlo Gomez</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-214</link>
		<dc:creator>Giancarlo Gomez</dc:creator>
		<pubDate>Sun, 05 Aug 2007 18:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-214</guid>
		<description>Rupesh,&lt;br/&gt;&lt;br/&gt;I tried this today on my box and got different results and can not figure our why. I used both the new listToArray in CF8 and the list2Array function from one of your previous post. The problem is that my delimiter is &quot;,&quot; (all three are the total delimiter). The list2array returns the correct amount of elements but CF8&#039;s listToArray returns 24 elements when there should only be 8. Below is the code I tested.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfscript&gt;&lt;br/&gt; // Empty List Function&lt;br/&gt;   function list2Array(list)&lt;br/&gt;   {&lt;br/&gt;       var i = 0; &lt;br/&gt;       var retlist = ArrayNew(1);&lt;br/&gt;       var arr = list.split(&#039;&quot;,&quot;&#039;,-1);&lt;br/&gt;       for(i = 1; i &lt;= ArrayLen(arr); i++)&lt;br/&gt;           ArrayAppend(retList,arr[i]);&lt;br/&gt;       return retList;&lt;br/&gt;   }&lt;br/&gt; theList=&#039;&quot;one&quot;,&quot;two&quot;,&quot;three&quot;,&quot;&quot;,&quot;four&quot;,&quot;&quot;,&quot;&quot;,&quot;seven&quot;&#039;;&lt;br/&gt; theArray1=listToArray(theList,&#039;&quot;,&quot;&#039;,true);&lt;br/&gt; theArray2=list2Array(theList);&lt;br/&gt;&lt;/cfscript&gt;&lt;br/&gt;&lt;cfdump var=&quot;#theArray1#&quot; /&gt;&lt;br/&gt;&lt;cfdump var=&quot;#theArray2#&quot; /&gt;</description>
		<content:encoded><![CDATA[<p>Rupesh,</p>
<p>I tried this today on my box and got different results and can not figure our why. I used both the new listToArray in CF8 and the list2Array function from one of your previous post. The problem is that my delimiter is &#8220;,&#8221; (all three are the total delimiter). The list2array returns the correct amount of elements but CF8&#8217;s listToArray returns 24 elements when there should only be 8. Below is the code I tested.</p>
<p>&lt;cfscript&gt;<br /> // Empty List Function<br />   function list2Array(list)<br />   {<br />       var i = 0; <br />       var retlist = ArrayNew(1);<br />       var arr = list.split(&#8217;&#8221;,&#8221;&#8216;,-1);<br />       for(i = 1; i < = ArrayLen(arr); i++)<br/>           ArrayAppend(retList,arr[i]);<br />       return retList;<br />   }<br /> theList=&#8217;&#8221;one&#8221;,&#8221;two&#8221;,&#8221;three&#8221;,&#8221;",&#8221;four&#8221;,&#8221;",&#8221;",&#8221;seven&#8221;&#8216;;<br /> theArray1=listToArray(theList,&#8217;&#8221;,&#8221;&#8216;,true);<br /> theArray2=list2Array(theList);<br />&lt;/cfscript&gt;<br />&lt;cfdump var=&#8221;#theArray1#&#8221; /&gt;<br />&lt;cfdump var=&#8221;#theArray2#&#8221; /&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-213</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Tue, 24 Jul 2007 13:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-213</guid>
		<description>Thanks Sam and Gary. Didn&#039;t we say that we listen to our users :-)</description>
		<content:encoded><![CDATA[<p>Thanks Sam and Gary. Didn&#8217;t we say that we listen to our users <img src='http://www.rupeshk.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gary gilbert</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-212</link>
		<dc:creator>gary gilbert</dc:creator>
		<pubDate>Mon, 23 Jul 2007 11:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-212</guid>
		<description>Great addition to CF8.  That has been something that I&#039;ve wanted in CF for ages!</description>
		<content:encoded><![CDATA[<p>Great addition to CF8.  That has been something that I&#8217;ve wanted in CF for ages!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-211</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 19 Jul 2007 20:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-211</guid>
		<description>There won&#039;t be a CF9! &lt;br/&gt;Everyone will die soon! :)</description>
		<content:encoded><![CDATA[<p>There won&#8217;t be a CF9! <br />Everyone will die soon! <img src='http://www.rupeshk.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Farmer</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/07/listtoarray-in-coldfusion-8/comment-page-1/#comment-210</link>
		<dc:creator>Sam Farmer</dc:creator>
		<pubDate>Thu, 19 Jul 2007 20:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/07/19/listtoarray-in-coldfusion-8/#comment-210</guid>
		<description>Cool.  Nice addition.  Glad you left something for CF9! ;)</description>
		<content:encoded><![CDATA[<p>Cool.  Nice addition.  Glad you left something for CF9! <img src='http://www.rupeshk.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

