Emily,

  A couple of points:

1) I don't use just lists.  I just tend to use lists rather than arrays.  I
love using structures :).

2) In the shopping bag example, for the store, the key would be the users
session ID.  I could do it with lists if I wanted.  Remember, a
3-dimensional array is nothing more than an array of arrays of arrays.
Since a 1- dimensional array is really a list, I could (and have) create a
list of lists of lists.  I wouldn't do that now, but I would have a version
or two ago.

3) I'm getting to run some speed tests to prove Nick's comment about speed
increases of arrays over lists.  That is a good reason to use arrays over
lists.

The biggest annoyance I have with arrays is that there always seems to be a
lot of looping and other programming overhead involved.  I do some
programming in C++ and Java, and use arrays and looping in those languages,
but in CF that creates a lot of overhead.


Chris Evans
[EMAIL PROTECTED]
http://www.fuseware.com


-----Original Message-----
From: Emily B. Kim [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 05, 2000 12:14 AM
To: [EMAIL PROTECTED]
Subject: RE: Help: Can arrays be used like queries


>  Hopefully not any different than the way you would do it in an array.  In
>your example below, I would have a structure for Product 1, a structure for
>Product 2, and so on.  I would also have an ItemInYourBag structure, with
>the key being the product ID and the value being the quantity.  If the
>product had more attributes, such as color or size, they would just be more
>members of the ItemInYourBag structure.
>
>The only list I would maintain would be the list of items in your bag,
which
>is the same as the StructKeyList(ItemInYourBag).
>
>I don't think this helped explain why I prefer lists rather than arrays, as
>my solution would be structures of structures.

yeah, i think that you can't do something that complex with just lists. you
would have to work with arrays and/or structures. the only "problem" i can
see with the structure of structures you have above has to do with what
would you be using as your key for the outer structure? you would have to
dynamically generate it, which seems like it would be more effort than just
using the index that is inherent in an array. -emily
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to