This is off the top of my head to display the theory - I don't have any real
sample code. The Shopping cart list would be a session variable, and the
products would be a Application variable.
Emily,
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.
Chris Evans
[EMAIL PROTECTED]
http://www.fuseware.com
-----Original Message-----
From: Emily B. Kim [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 04, 2000 11:17 AM
To: [EMAIL PROTECTED]
Subject: Re: Help: Can arrays be used like queries
> I always end up using lists rather than arrays, though a list can be
thought
> of as a 1-dimensional array. So I would use a list of structures rather
> than an array of structures. I find Lists easier to create and maintain
> than arrays.
how do you work with a list of structures when you have multiple
structures for each element like so:
array elements for the shopping cart with nested structures:
[1] product 1 - product_price=$10
product_name="Some Name"
Prodcut_ID=4
[2] product 2 - product_price=$15
product_name="Second Name"
Prodcut_ID=10
[3] product 3 - product_price=$20
product_name="Third Name"
Prodcut_ID=14
i'd be interested in seeing your code for something like this using
lists. how are you processing it? -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.