How to append a structure to another in ColdFusion

StructAppend() - append one structure to another

StructAppend.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>StructAppend function example: how to append one structure to another</title>
</head>

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

<cfset Color=StructNew()>
<cfset Color.ID=1>
<cfset Color.Name="HoneyDew">
<cfdump var="#Color#" label="Color">
<br />

<cfset ColorValue=StructNew()>
<cfset ColorValue.Value="##F0FFF0">
<cfdump var="#ColorValue#" label="ColorValue">

<br />
<cfset Temp=StructAppend(Color,ColorValue,"yes")>
<cfdump var="#Color#" label="Color[After append ColorValue]">

</body>
</html>





More ColdFusion examples