User Guide
848 Chapter 3: ColdFusion Functions
StructAppend
Description
Appends one structure to another.
Returns
True, upon successful completion; False, otherwise.
Category
Structure functions
Function syntax
StructAppend(struct1, struct2, overwriteFlag)
See also
Structure functions; “Modifying a ColdFusion XML object” in Chapter 35, “Using XML and
WDDX,” in ColdFusion MX Developer’s Guide
History
ColdFusion MX: Changed behavior: this function can be used on XML objects.
Parameters
Usage
This function appends the fields and values of struct2 to struct1; struct2 is not modified. If
struct1 already contains a field of struct2, overwriteFlag determines whether the value in
struct2 overwrites it.
A structure’s keys are unordered.
Example
<html>
<body>
<!---- Create a Name structure --->
<cfset nameCLK=StructNew()>
<cfset nameCLK.first="Chris">
<cfset nameCLK.middle="Lloyd">
<cfset nameCLK.last="Gilson">
<!--- Create an address struct --->
<cfset addrCLK=StructNew()>
<cfset addrCLK.street="17 Gigantic Rd">
Parameter Description
struct1 Structure to which struct2 is appended.
struct2 Structure that contains the data to append to
struct1
overwriteFlag • True or "Yes": values in struct2 overwrite corresponding values in struct1.
Default.
• False or "No": values in
struct2 do not overwrite corresponding values in
struct1.