StructDelete() Function - Remove an element from a structure
StructDelete.cfm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>StructDelete function example: how to remove an element from a structure</title>
</head>
<body>
<h2 style="color:HotPink">StructDelete Function Example</h2>
<cfset Color=StructNew()>
<cfset Color.ID=1>
<cfset Color.Name="LawnGreen">
<cfset Color.Value="##7CFC00">
<cfdump var="#Color#" label="Color">
<br />
<cfset Temp=StructDelete(Color,"Value")>
<cfdump var="#Color#" label="Color[after delete value key]">
</body>
</html>
- IsStruct() - Check whether a variable is a structure
- StructAppend() - Append a structure to another
- StructClear() - Remove all data from a structure
- StructCount()- Count the keys in a structure
- StructFind() - Find the value associated with a key in a structure
- StructInsert() - Insert a key value pair into a structure
- StructKeyArray() - Get an array of keys from a structure
- StructKeyExists() - Check whether a specific key is present in a structure
- StructNew() - Create a new structure
- StructUpdate() - Update a structure key with a value