Structures dont need to be the same type while arrays do (at least in C).
But since you do not declare a type in CF CF's structures are really
associative arrays (arrays with a named index).

On Fri, 14 Jun 2002, Gyrus wrote:

> ----- Original Message -----
> From: "Phoeun Pha" <[EMAIL PROTECTED]>
>
>
> I always found structures to be harder to work with than arrays.  in
> fact i
> find nothing useful with structure (cuz of ignorance, of course)  :)
>
> Can someone gimme an example of when a structure should be used and what
> not?  Cuz structures are one of the few main things I have left to touch
> in
> Coldfusion.
> -----------------------------
>
> I could be wrong on the following, cos I'm just looking into PHP after 2
> years of only using CF - so my knowledge of languages in general is not
> great.
>
> But reading about arrays in PHP, I was wondering how it deals with
> structures. It doesn't. From what I can see, 'structures' are just CF's
> way of creating 'associative arrays'. Which is, instead of referring to
> an element in an array via the number of it's position (e.g. myArray[3]
> for the 3rd element), each element has a string associated with it, and
> you refer to the element using that string. In CF, the string is the
> "key" and the element is the "value". Any correct me if this isn't
> right, I'm just learning myself.
>
> As for example, can't think of any offhand. But once you understand how
> they work (very straightforward, just cobble together a quick practice
> test), you should start to guess where to use them. Maybe you've not
> actually needed them yet...
>
> - Gyrus
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> - [EMAIL PROTECTED]
> work: http://www.tengai.co.uk
> play: http://www.norlonto.net
> - PGP key available
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to