Structcount - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

StructCount

Description
Counts the keys in a structure.
Returns
A number; if structure does not exist, throws an exception.
Category
Structure functions
Function syntax
StructCount(structure)
See also
Structure functions
History
ColdFusion MX: Changed behavior: this function can be used on XML objects.
Parameters
Parameter
structure
Example
<!--- This view-only example shows use of StructCount. --->
<p>This file is similar to addemployee.cfm, which is called by
StructNew, StructClear, and StructDelete. To test, copy
StructCount function to appropriate place in addemployee.cfm.
<!---
<cfswitch expression = "#ThisTag.ExecutionMode#">
<cfcase value = "start">
<cfif StructIsEmpty(attributes.EMPINFO)>
<cfoutput>Error. No employee data was passed.</cfoutput>
<cfexit method = "ExitTag">
<cfelse>
<cfquery name = "AddEmployee" datasource = "cfsnippets">
INSERT INTO Employees
(FirstName, LastName, Email, Phone, Department)
VALUES
<cfoutput>
(
'#StructFind(attributes.EMPINFO, "firstname")#' ,
'#StructFind(attributes.EMPINFO, "lastname")#' ,
'#StructFind(attributes.EMPINFO, "email")#' ,
'#StructFind(attributes.EMPINFO, "phone")#' ,
'#StructFind(attributes.EMPINFO, "department")#'
)
</cfoutput>
</cfquery>
</cfif>
<cfoutput><hr>Employee Add Complete
<p>#StructCount(attributes.EMPINFO)# columns added.</cfoutput>
</cfcase>
</cfswitch> --->
Description
Structure to access
StructCount
697

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents