structAppend

Appends one structure to another.

structAppend(destStruct, sourceStruct [, overwriteFlag]) → returns boolean

Argument Reference for the structAppend function

destStruct

Required: Yes
Structure to append.

sourceStruct

Required: Yes
Structure that contains the data to append to destStruct

overwriteFlag

Required: No
Default: YES
Yes: values in sourceStruct overwrite corresponding values in
destStruct. Default.

Compatibility

ColdFusion:

CF 6+ can be used on XML objects as well as structures.

Examples sample code invoking the structAppend function


Append options to config struct

config = {a:0, b:0};
options= {b:1, c:1};
structAppend(config, options, true);
writeOutput( serializeJSON( config ) );

Expected Result: {"A":0,"B":1,"C":1}


Fork me on GitHub