Contents > CFML Reference > ColdFusion Functions > IsObject PreviousNext

IsObject

Determines whether a value is an object.

True, if the value represents a ColdFusion object. False if the value is any other type of data, such as an integer, string, date, or struct.

Decision functions

IsObject(value)

IsDate, IsNumeric, IsNumericDate, IsQuery, IsSimpleValue, IsStruct, IsWDDX, IsXmlDoc, IsXmlElem, IsXmlRoot

ColdFusion MX: Added this function.

Parameter

Description

value

A value, typically the name of a variable.

This function returns False for query and XML objects.

<!--- to use this example, create a color.cfc component as follows: --->
<!--- 
<cfcomponent>
    <cffunction name="myFunction" access="public" returntype="string">
        <!--- Create a structure object --->
      <cfset myColor = "Blue">
      <cfreturn myColor>
    </cffunction>
</cfcomponent>
--->

<!--- Create an instance of the color.cfc component --->
<cfobject name="getColor" component="color">

<cfif IsObject(getColor)>
   <!--- Invoke the myFunction method --->
   <cfinvoke
      component="#getColor#"
      method="myFunction"
      returnVariable="myColor">
   </cfinvoke>

   <cfif IsDefined("myColor")>
      <!--- Output the returned variable --->
      The value of myColor = <cfoutput>#myColor#</cfoutput><p>
   </cfif>
</cfif>


Contents > CFML Reference > ColdFusion Functions > IsObject 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.