<?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: JSON-ish method for creating ColdFusion structures</title>
	<atom:link href="http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures</link>
	<description></description>
	<lastBuildDate>Thu, 01 Jun 2017 18:51:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gatzby</title>
		<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/comment-page-1#comment-365</link>
		<dc:creator>Gatzby</dc:creator>
		<pubDate>Tue, 19 Sep 2006 13:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/#comment-365</guid>
		<description>A quick way to create an array is to use the ListToArray() function:

myArray=ListToArray(&quot;alpha,beta,gamma,delta&quot;);

No such trick for structs, though. I used a custom tag for a while, but that isn&#039;t much use in cfscript:

&lt;code&gt;&lt;cf_struct _name=&quot;greek&quot; first=&quot;alpha&quot; seond=&quot;beta&quot; third=&quot;gamma&quot; [...] /&gt;&lt;/code&gt;

The custom tag simply loops through it&#039;s attributes struct and uses the _name attribute to create a struct of that name in the caller scope.</description>
		<content:encoded><![CDATA[<p>A quick way to create an array is to use the ListToArray() function:</p>
<p>myArray=ListToArray(&#8220;alpha,beta,gamma,delta&#8221;);</p>
<p>No such trick for structs, though. I used a custom tag for a while, but that isn&#8217;t much use in cfscript:</p>
<p><code>&lt;cf_struct _name="greek" first="alpha" seond="beta" third="gamma" [...] /&gt;</code></p>
<p>The custom tag simply loops through it&#8217;s attributes struct and uses the _name attribute to create a struct of that name in the caller scope.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/comment-page-1#comment-215</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Fri, 18 Aug 2006 20:59:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/#comment-215</guid>
		<description>Good points.  Nathan Dintenfass also mentioned that you could reduce the amount of typing using the foo.values[1] = 0; foo.values[2] = 5; syntax, but I would prefer a function based shortcut (if we can&#039;t have &quot;CFON&quot;).

Where do you store these for easy access?  App scope?  Request scope?  CFC?</description>
		<content:encoded><![CDATA[<p>Good points.  Nathan Dintenfass also mentioned that you could reduce the amount of typing using the foo.values[1] = 0; foo.values[2] = 5; syntax, but I would prefer a function based shortcut (if we can&#8217;t have &#8220;CFON&#8221;).</p>
<p>Where do you store these for easy access?  App scope?  Request scope?  CFC?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan G. Switzer, II</title>
		<link>http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/comment-page-1#comment-214</link>
		<dc:creator>Dan G. Switzer, II</dc:creator>
		<pubDate>Fri, 18 Aug 2006 20:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/2006/08/18/json-ish-method-for-creating-coldfusion-structures/#comment-214</guid>
		<description>To create an array, just write a UDF called arrayCreate() (I use structCreate() and arrayCreate() to be more consistent w/CF nomenclature) you need to loop through the arguments array. It&#039;s not a true array--but some kind of hybrid struct/array.

If you don&#039;t create the array by looping through the arguments array, some of the array functions won&#039;t work on it.

I actually use both UDFs in my work as it does make it much easier to create arrays and structures.

I&#039;d really like to see these functions become native to CF.

PS - The reason I don&#039;t like using the listToArray() is you can&#039;t use the delimiter in your values or it creates a problem. Having a true UDF that converts an list of arguments to an array is much more useful.</description>
		<content:encoded><![CDATA[<p>To create an array, just write a UDF called arrayCreate() (I use structCreate() and arrayCreate() to be more consistent w/CF nomenclature) you need to loop through the arguments array. It&#8217;s not a true array&#8211;but some kind of hybrid struct/array.</p>
<p>If you don&#8217;t create the array by looping through the arguments array, some of the array functions won&#8217;t work on it.</p>
<p>I actually use both UDFs in my work as it does make it much easier to create arrays and structures.</p>
<p>I&#8217;d really like to see these functions become native to CF.</p>
<p>PS &#8211; The reason I don&#8217;t like using the listToArray() is you can&#8217;t use the delimiter in your values or it creates a problem. Having a true UDF that converts an list of arguments to an array is much more useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
