View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > IsStruct PreviousNext

IsStruct

Determines whether a variable is a structure.

True, if variable is a ColdFusion structure or is a Java object that implements the java.lang.Map interface. Returns False if the object in variable is a user-defined function (UDF).

Decision functions, Structure functions

IsStruct(variable)

Structure functions

ColdFusion MX: Changed behavior: this function can be used on XML objects.

Parameter

Description

variable

Variable name

<!--- This view-only example shows the use of IsStruct. --->
<p>This file is similar to addemployee.cfm, which is called by StructNew,
StructClear, and StructDelete. It is an example of a custom tag used to
add employees. Employee information is passed through the employee
structure (the EMPINFO attribute). In UNIX, you must also add the Emp_ID. <!--- <cfswitch expression = "#ThisTag.ExecutionMode#"> <cfcase value = "start"> <cfif IsStruct(attributes.EMPINFO)> <cfoutput>Error. Invalid data.</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</cfoutput> </cfcase> </cfswitch> --->

Contents > CFML Reference > ColdFusion Functions > IsStruct PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


halL said on Sep 15, 2006 at 6:59 AM :
User jladams97 has correctly noted that this function returns true on a CFC that you create as an object (e.g., using cfobject component=....).
(Tested on CFMX 7,not 6.1, but presumed true for 6.1 also.)

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/funct141.htm