> Can anyone give me a very basic, real-world example of when and why
> you would want to use an array and a structure?
>
> I mainly work with queries from a database, and can't wrap my mind
> around what an array and a structure will do for me.

Think of an array as a single column in a recordset.  You have the
ability to have multiple values of the same data type stored under a
single variable name.  As for a use, they are faster and easier to
program with than going out and getting a recordset from a database.

ColdFusion also has a lot of tools that let you work between lists of
values and arrays, making an array a good intermediary point if you're
doing a lot of text parsing.

Think of a structure as a single record in a recordset.  You have one
main variable name with several different property names and property
values.

To make things even more confusing, or turn things around, a recordset
is an array of structures.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 beta – Build next generation applications today.
Free beta download on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2806
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to