MACROMEDIA COLDFUSION 5 - CFML Reference page 622

Cfml reference
Hide thumbs Also See for COLDFUSION 5 - CFML:
Table of Contents

Advertisement

604
</cfoutput>
<hr>
<b>Copied structure values should be the same as the original.</b><br>
<cfoutput>
</cfoutput>
// This script creates a structure that StructCopy copies by reference.
<cfscript>
</cfscript>
<!--- Output original structure --->
<hr>
<b>Original Values</b><br>
<cfoutput>
</cfoutput>
// Use StructCopy to copy this structure to a new structure. <br>
<cfset copied = StructCopy(s)>
// Use Duplicate to clone this structure to a new structure. <br>
<cfset duplicated = Duplicate(s)>
<cfscript>
s.number = #s.number#<br>
s.string = #s.string#<br>
// Array value <br>
s.array[1][1] = #s.array[1][1]#<br>
s.array[1][2] = #s.array[1][2]#<br>
// Simple values <br>
copied.number = #copied.number#<br>
copied.string = #copied.string#<br>
// Array value <br>
copied.array[1][1] = #copied.array[1][1]#<br>
copied.array[1][2] = #copied.array[1][2]#<br>
// Create elements.
s = StructNew();
s.nested = StructNew();
s.nested.array = ArrayNew(2);
// Assign simple values to nested structure fields.
s.nested.number = 99;
s.nested.string = "hello tommy";
// Assign values to nested array.
s.nested.array[1][1] = "one one";
s.nested.array[1][2] = "one two";
// Simple values <br>
s.nested.number = #s.nested.number#<br>
s.nested.string = #s.nested.string#<br>
// Array values <br>
s.nested.array[1][1] = #s.nested.array[1][1]#<br>
s.nested.array[1][2] = #s.nested.array[1][2]#<br>
Chapter 3 ColdFusion Functions

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 5 - CFML and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 5

Table of Contents