StructClear
Clear all items from struct
Method Signature
StructClear(structure=[modifiableStruct])
Arguments
Argument
Type
Required
Description
Default
structure
modifiableStruct
true
The struct to clear.
Examples
Script Syntax
profile = {
NAME : "John",
INSTRUMENT : "guitar",
OCCUPATION : "singer"
};
structClear( profile );
writeOutput( JSONSerialize( profile ) );
Result: An empty struct
Tag Syntax
<bx:set profile = {
NAME : "John",
INSTRUMENT : "guitar",
OCCUPATION : "singer"
} >
<bx:set structClear( profile ) >
<bx:dump var="#profile#"/>
Result: An empty struct
Additional Examples
animals = {
COW : "moo",
PIG : "oink"
};
// Show current animals
Dump( label="Current animals", var=animals );
// Clear struct
structClear( animals );
// Show animals, now empty
Dump( label="Animals after calling StructClear()", var=animals );
Related
Last updated
Was this helpful?