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

Run Example

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

Run Example

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 );

Last updated

Was this helpful?