Thanks Charlie... I'll check that out ... thanks to everyone else for
explaining arrays and structure options

-----Original Message-----
From: Charlie Griefer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 29, 2004 11:08 AM
To: CF-Talk
Subject: Re: first time array

Hi Tim:

If you've got a few minutes, I put together what I think is a pretty
decent
intro to arrays and structs in CF (3 parter):

http://tutorial171.easycfm.com/
http://tutorial172.easycfm.com/
http://tutorial173.easycfm.com/

Hope it helps.
Charlie

----- Original Message -----
From: "Tim Laureska" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, June 29, 2004 7:58 AM
Subject: RE: first time array

> OK... so in the case I have... a form where a client enters cassette
> reference material into a form (each cassette has 4 attributes...
issue
> no., cassette title, date and publication title) an array would appear
> to be better since there would be upwards of 25-30 cassettes entered
at
> one time..no? Haven't played with structure yet, so ..
>
> -----Original Message-----
> From: Dave Watts [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 29, 2004 10:52 AM
> To: CF-Talk
> Subject: RE: first time array
>
> > Tony... why are structures a better way to go than than arrays
>
> While I'm not Tony, I wouldn't say that structures are better than
> arrays or
> vice-versa. They're different, and which is best for you at a specific
> time
> depends on what you're trying to accomplish.
>
> If you're trying to describe the attributes of a single thing, a
> structure
> usually makes more sense. If, on the other hand, you're trying to
> describe a
> bunch of items together, an array usually makes more sense. If you
want
> to
> describe the attributes of each item within an array, you can create
an
> array of structures.
>
> <!--- structure example --->
> <cfset mydog = StructNew()>
> <cfset mydog.name = "Fido">
> <cfset mydog.breed = "Chihuahua">
> ...
>
> <!--- array example --->
> <cfset mycart = ArrayNew(1)>
> <cfset mycart[1] = "bread">
> <cfset mycart[2] = "milk">
> ...
>
> <!--- array of structures example --->
> <cfset mycart = ArrayNew(1)>
> <cfset mycart[1] = StructNew()>
> <cfset mycart[1].name = "bread">
> <cfset mycart[1].price = 2.5>
> <cfset mycart[2] = StructNew()>
> <cfset mycart[2].name = "milk">
> <cfset mycart[2].price = 2.25>
> ...
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> phone: 202-797-5496
> fax: 202-797-5444
>
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to