Counts the keys in a structure.
A number; if structure does not exist, throws an exception.
StructCount(structure)
Structure functions; Modifying a ColdFusion XML object in the Developing ColdFusion Applications
ColdFusion MX: Changed behavior: this function can be used on XML objects.
Parameter |
Description |
|---|---|
structure |
Structure to access. |
<cfscript>
myStruct={a:1,b:2,c:3,d:4,e:5}; //Define the structure keys
myCount=StructCount(myStruct); //Count the number of keys in myStruct
WriteOutput(#myCount#); //Display value of myCount
</cfscript>
5
<cfscript>
myStruct={a:1,b:2,c:3,d:4,e:5}; //Define the structure keys
WriteOutput(myStruct.count()); // Count the number of keys in input struct
</cfscript>
Sign in to your account