structDelete

Removes an element from a structure.

structDelete(structure, key [, indicateNotExisting]) → returns boolean

Argument Reference for the structDelete function

structure

Required: Yes
Structure or a variable that contains one. Contains element
to remove

key

Required: Yes
Element to remove

indicateNotExisting

Required: No
Default: NO
When true this function will return true only if they key that will be deleted existed. When false (default) this function will return true if the key is successfully removed.

Examples sample code invoking the structDelete function


Remove a key from a struct

Creates a struct then removes a key

someStruct = {a=1,b=2};
structDelete(someStruct, "a");
writeDump(someStruct);

Fork me on GitHub