Sometimes a structure can be easier to remember how to access

example:

Personnal info

First name
Last name
age
sex
etc

An array would be entered like:

info[1] = "fname"
info[2] = "lname"
info[3] = "age"

I would have to remember that info[3] was age,
but if you use a structure you would do something like

info.fname = "fname"
info.lname = "lname"
info.age = "age"

for me this make it easier to read the code later and tell what I am looking
for

 <TD> #info[3]#</TD>
  Versis
 <TD> #info.age#</TD>

Again just my opion but the second one makes it easier to debug and maintain
the code.
this is one example why I like structure, sometimes over arrays.





-----Original Message-----
From: Phoeun Pha [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 2:41 PM
To: CF-Talk
Subject: Structure vs. array


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.

And now for something a little off topic.  I am so happy I have a job!
Aren't you?! :)


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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