StructUpdate()

edit

Updates a key with a value.

StructUpdate( struct=struct, key=string, value=any );

Returns: Boolean

Argument Description
struct
struct, required
edit

Structure to update

Alias: structure, object

key
string, required
edit

Key, the value of which to update

value
any, required
edit

New value

Examples

edit

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