StructUpdate()
Updates a key with a value.
StructUpdate( struct=struct, key=string, value=any );
Returns: Boolean
Argument | Description |
---|---|
struct
struct,
required
|
Structure to update Alias: structure, object |
key
string,
required
|
Key, the value of which to update |
value
any,
required
|
New value |
Examples
Non-Member Function
animals = {
cow: "moo",
pig: "oink",
cat: "meow"
};
// Show current animals
Dump(
label: "Current animals",
var: animals
);
// Update cat in animals
StructUpdate(animals, "cat", "purr");
// Show animals with updated cat in animals
Dump(
label: "Animals with cat updated",
var: animals
);
See also
- Structures
- struct.update()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)