StructDelete

Removes an element from a structure.

StructDelete( structure, key [, indicatenotexisting ] )

Returns: Boolean

Argument Description
structure
struct, required

Structure contains element to remove.

key
string, required

Element to remove

indicatenotexisting
boolean, optional

Examples

Member Function

animals = {
	cow: "moo",
	pig: "oink",
	cat: "meow"
};
// Show current animals
Dump(
	label: "Current animals",
	var: animals
);
// Delete the key 'cat' from struct
animals.delete("cat");
// Show animals, cat has been deleted
Dump(
	label: "Animals with cat deleted",
	var: animals
);

Non-Member Function

animals = {
	cow: "moo",
	pig: "oink",
	cat: "meow"
};
// Show current animals
Dump(
	label: "Current animals",
	var: animals
);
// Delete the key 'cat' from struct
StructDelete(animals, "cat");
// Show animals, cat has been deleted
Dump(
	label: "Animals with cat deleted",
	var: animals
);

See also