StructInsert() - insert a key value pair into a structure
StructInsert.cfm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>StructInsert function example: how to insert a key value pair into a structure</title>
</head>
<body>
<h2 style="color:HotPink">StructInsert Function Example</h2>
<cfset Color=StructNew()>
<cfdump var="#Color#" label="Color">
<cfset Temp=StructInsert(Color,"ID",1,"yes")>
<cfset Temp=StructInsert(Color,"Name","Green","yes")>
<cfset Temp=StructInsert(Color,"Value","##008000","yes")>
<br />
<cfdump var="#Color#" label="Color[after insert data]">
</body>
</html>
- IsStruct() - check whether a variable is a structure
- StructAppend() - append one structure to another
- StructFind() - find the value associated with a key in a structure
- StructIsEmpty() - determine whether a structure contains data
- StructKeyExists() - check whether a specific key is present in a structure
- StructKeyList() - get a list of keys from a structure
- StructNew() - create a structure
- StructUpdate() - update a structure key with a value
- cfdump - dump a structure