StructAppend()
Appends all the data from struct2 into struct1, replacing duplicate keys unless specified by the overwrite flag
StructAppend( Struct1=struct, Struct2=struct, OverwriteFlag=boolean );
Returns: Boolean
Examples
Non-Member Function
animals = {
cow: "moo",
pig: "oink"
};
// Show current animals
Dump(
label: "Current animals",
var: animals
);
// Create a new animal
newAnimal = {
cat: "meow"
};
// Append the newAnimal to animals
StructAppend(animals, newAnimal);
// Show animals, now includes cat
Dump(
label: "Animals with cat added",
var: animals
);
See also
- Structures
- struct.append()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)