To try in simplify Jim's explanation (I hope).  In ColdFusion, structures are passed by reference.  Thus if you do something like this:


<cfset struct_1 = strutNew()>
<cfset struct_2 = struct_1>


Both variables reverence the some data in memory, even if one of the variables is private to a function, method and/or component.


The simple solution to do what you want is
<cffunction ...>
            <cfset var something = "">


            <cfset something = duplicate(struct_1)>
</cfunction>


The duplicate function creates a complete copy of the passed structure into a different memory location with a different label.

--------------
Ian Skinner
Web Programmer
BloodSource
<file:///C:\Documents%20and%20Settings\iskinner\Application%20Data\Microsoft\Signatures\www.BloodSource.org> www.BloodSource.org <http://www.BloodSource.orgSacramento>
Sacramento, CA

"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to