How to remove all data from a structure in ColdFusion

StructClear() - remove all data from a structure

StructClear.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>StructClear function example: how to remove all data from a structure</title>
</head>

<body>
<h2 style="color:HotPink">StructClear Function Example</h2>

<cfset Color=StructNew()>
<cfset Color.ID=1>
<cfset Color.Name="Ivory">
<cfset Color.Value="##FFFFF0">

<cfdump var="#Color#" label="Color">

<cfset Temp=StructClear(Color)>

<br />
<cfdump var="#Color#" label="Clear[After clear data]">

</body>
</html>






More ColdFusion examples