ColdFusion Loops cfloop

COM Collection/Structure Loops

You can loop over a Structure or COM collection.

<cfset myBooks = StructNew()>
<cfset myVariable = StructInsert(myBooks,"ColdFusion","ColdFusion MX Bible")>
<cfset myVariable = StructInsert(myBooks,"HTML","HTML Visual QuickStart")>
<cfset myVariable = StructInsert(myBooks,"XML","Inside XML")>
<cfloop collection="#myBooks#" item="subject">
  <cfoutput>
 <b>#subject#:</b> #StructFind(myBooks,subject)#<br />
 </cfoutput>
</cfloop>

Display in browser:
ColdFusion: ColdFusion MX Bible
HTML: HTML Visual QuickStart
XML: Inside XML
via ColdFusion Loops cfloop.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>