Name

StructFind

Synopsis

StructFind(structure, key)

Searches structure and returns the value for the specified key. Here’s an example that searches the structure Stock for various keys:

<CFSET Stock = StructNew(  )>
<CFSET Stock.Company = "Allaire">
<CFSET Stock.Ticker = "ALLR">
<CFSET Stock.Exchange = "NASDAQ">
<CFSET Stock.Price = "66.25">
<CFSET Stock.Change = "+0.375">
<CFSET Stock.LastTradeTime = "10:17AM">
<CFSET Stock.LastTradeDate = "05/17/1999">
<CFSET Stock.Volume = "8300">

<CFOUTPUT>
Find the value of the key <B>company</B>: #StructFind(Stock, "company")#<BR>
Find the value of the key <B>Ticker</B>: #StructFind(Stock, "ticker")#<BR>
Find the value of the key <B>exchange</B>: #StructFind(Stock, "exchange")#<BR>
Find the value of the key <B>price</B>: #StructFind(Stock, "price")#<BR>
Find the value of the key <B>change</B>: #StructFind(Stock, "change")#<BR>
Find the value of the key <B>lasttradetime</B>: 
  #StructFind(Stock, "lasttradetime")#<BR>
Find the value of the key <B>lasttradedate</B>: 
  #StructFind(Stock, "lasttradedate")#<BR>
Find the value of the key <B>volume</B>: #StructFind(Stock, "volume")#
</CFOUTPUT>

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.