Inside Coldfusion MX

"-->

StructCopy (structure)

Description

Makes a copy of a structure. Copies top-level keys, values, and arrays in the structure by value. The copy is not by reference, meaning changes to the original structure will not be reflected in the copy. To copy deeply nested structures, use the Duplicate function.

Example

<cfscript> Products = StructNew(); StructInsert(Products , "ProductName", "Blizzard Blender"); StructInsert(Products , "ProductID", 1001); StructInsert(Products , "SKU", "555-6582"); </cfscript> <cfset copyStruct = StructCopy(Products)> <cfoutput> #copyStruct.ProductName# #copyStruct.ProductID# #copyStruct.SKU# </cfoutput>

Категории