Very true Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com
-----Original Message----- From: Dave Watts [mailto:[email protected]] Sent: Tuesday, March 09, 2010 9:36 PM To: cf-talk Subject: Re: query passed by value from a udf? > You can circumvent this using duplicate( ) > > <cfset test = duplicate(test())/> > > Which makes a deep copy of the object by value. While you can do this, usually you shouldn't. Creating duplicate objects is expensive, which is why the default behavior of CF is to pass queries and structures by reference. This approach is common in many other programming languages as well. You should only create a deep copy when you explicitly want to have two separate variables that will presumably be manipulated in different ways. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331518 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

