How to get a list of keys from a structure in ColdFusion

StructKeyList() - get a list of keys from a structure

StructKeyList.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>StructKeyList function example: how to get a list of keys from a structure</title>
</head>

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

<cfset Color=StructNew()>
<cfset Color.ID=1>
<cfset Color.Name="LightGoldenRodYellow">
<cfset Color.Value="##FAFAD2">
<cfdump var="#Color#" label="Color">

<cfset KeyList=StructKeyList(Color,";")>
<br />
<cfoutput>
<b>
Color Structure Key List: #KeyList#
</b>
</cfoutput>
</body>
</html>





More ColdFusion examples