Name

IsStruct

Synopsis

IsStruct(variable)

Returns True if the specified variable is a ColdFusion structure or False if it isn’t. Examples:

<CFSET Stock = StructNew(  )>

<CFSET StructInsert(Stock, "company", "Allaire")>
<CFSET StructInsert(Stock, "ticker", "ALLR")>
<CFSET StructInsert(Stock, "exchange", "NASDAQ")>
<CFSET StructInsert(Stock, "price", "66.25")>
<CFSET StructInsert(Stock, "change", "+0.375")>
<CFSET StructInsert(Stock, "lasttradetime", "10:17AM")>
<CFSET StructInsert(Stock, "lasttradedate", "05/17/1999")>
<CFSET StructInsert(Stock, "volume", "8300")>

<CFSET MyList = "Allaire, ALLR, NASDAQ, 66.25, +0.375, 10:17AM, 05/17/1999, 8300">

<CFIF IsStruct(Stock)>
  <B>Stock</B> is a structure.
<CFELSE>
  <B>Stock</B> isn't a structure.
</CFIF>
<P>
<CFIF IsStruct(MyList)>
  <B>MyList</B> is a structure.
<CFELSE>
  <B>MyList</B> isn't a structure.
</CFIF>

Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.