> CF handles complex variables by reference, but simple
> variables by value...
This is a bit of an oversimplification. Queries and structures are passed by
reference, but arrays are passed by value. I thought that arrays were passed
by reference before, but I was wrong. Here's a demonstration:
<html>
<head>
<title>Arrays Passed By Value</title>
</head>
<body>
<cfset myarray1 = ArrayNew(1)>
<cfset myarray1[1] = "Dave">
<cfset myarray2 = myarray1>
<cfset myarray1[1] = "Bob">
<cfloop index="i" from="1" to="#ArrayLen(myarray2)#">
<cfoutput>#myarray2[i]#<br></cfoutput>
</cfloop>
</body>
</html>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists