Yes, structures are basically the same as associative arrays. The cool thing
with CF structure though is you can refer to elements using names instead of
numerics. Try:

<cfset Groups=structnew()>
        <cfset Groups.ID="x">
        <cfset Groups.Website="xyz.com">

To reference elements use: Groups[website]
Read up on structures to geet a feel for making things more dynamic, and
looping over structures,etc.

HTH
Matt


-----Original Message-----
From: Chris Martin [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 24, 2000 1:39 PM
To: CF-Talk
Subject: Associative Arrays?


Hey everyone.  I was wondering if Cold Fusion offers associative arrays, or
hashes as they are called in perl.

What I want to do is somethign like this:

Group, Group's Website, Group, et cetera.

So that when i need to, I can refer to the groups website by

arraryname[group]

any suggestions?

Chris Martin

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to