Description

Removes all data from a structure.

Returns

True, on successful execution; False, otherwise.

Category

Syntax

StructClear(structure)

See also

Structure functionsModifying a ColdFusion XML object in the Developing ColdFusion Applications

History

ColdFusion MX: Changed behavior: this function can be used on XML objects.

Parameters

Parameter

Description

structure

Structure to clear.

Example

<cfscript>
       myStruct={a:1,b:2,c:3,d:4,e:5}; //Define the structure keys
       WriteOutput("Struct with data:");
       WriteDump(myStruct);
       StructClear(myStruct); //Remove data from the struct myStruct
       WriteOutput("Struct after data removal:");
       WriteDump(myStruct);
</cfscript>

Output

structclear output
structclear output

Using member function

<cfscript>
       myStruct={a:1,b:2,c:3,d:4,e:5}; //Define the structure keys
       WriteOutput("Using member functions");
       WriteOutput(myStruct.clear());
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy