<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - coldfusion - 7 - htmldocs - 00000393.htm</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T20:54:16</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000393.htm#82903" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000393.htm#82831" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000393.htm#82903">
		<title>coldfusion/7/htmldocs/00000393.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000393.htm#82903</link>
		<description>This behavior is expected, as ColdFusion accesses structures by reference.</description>
		<dc:creator>halL</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2008-04-11T06:50:48</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000393.htm#82831">
		<title>coldfusion/7/htmldocs/00000393.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000393.htm#82831</link>
		<description>I used this function for the first time and stumbled upon an unexpected behavior.&lt;br /&gt;&lt;br /&gt;When using ArraySet to initialize an array, if the &quot;value&quot; is a struct, or in my case the return value of the structNew function then the array cells are initialized with the reference to a single struct, which means that modifiying the content of any array cell modifies the refernced struct hence all array cells.&lt;br /&gt;&lt;br /&gt;This is unexpected because I was assuming that ArraySet would set the cells by vakue not reference even for complex objects.&lt;br /&gt;&lt;br /&gt;Code example:&lt;br /&gt;&lt;br /&gt;&lt;cfscript&gt;&lt;br /&gt;example = arrayNew(1);&lt;br /&gt;ArraySet(example, 1, 10, structNew());&lt;br /&gt;for (i=1; i LTE ArrayLen(example ); i=i+1)&lt;br /&gt;{&lt;br /&gt;  example[i].id = i;&lt;br /&gt;}&lt;br /&gt;&lt;/cfscript&gt;&lt;br /&gt;&lt;cfdump var=&quot;#example#&quot; /&gt;</description>
		<dc:creator>campem</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-04-09T14:04:37</dc:date>
	</item>
	</rdf:RDF>

