MACROMEDIA COLDFUSION 5-CFML Reference - page 427
Alphabetical List of ColdFusion Functions
409
Duplicate
Description
Returns a clone, also known as a deep copy, of a variable. Unlike
StructCopy
,
Duplicate
copies the variable, so there is no reference to the original variable.
Category
Structure functions
Syntax
Duplicate(variable_name)
See also
StructCopy
Parameters
Usage
This function is useful in duplicating complex structures, including nested structures
and queries.
Note
You cannot duplicate a COM, CORBA or JAVA object returned from the cfobject tag
or the
CreateObject
function. If an element in an array or a field of a structure is a
COM, CORBA, or JAVA object, you cannot duplicate the array or structure. If you try
to duplicate an object of this sort, an exception is thrown.
Example
Duplicate Example
The copy contains the modified value: #copy.nested.item#
The duplicate contains the original value: #clone.nested.item#