this is what i am trying to do

T

tony collier

ok . thanks everyone for your advice so far. this is what i am trying to
do and there is probably a much better way which this newbie hasn't read
or thought about yet.

i am getting prices from x number of suppliers who all quote me a
different individual price for each of y items. no one supplier is always
cheaper than the others.

no. of suppliers: x (preferably unlimited)

no. of items: y (again, preferably unlimited)

i then calculate all the different combination of items from mixed
suppliers. The formula to work out number of combinations =

no.of supplier ^ (to the power of) no. of items.

this requires creating an array of y dimensions with x elements per
dimension to store all combinations

as you will now understand , i have so far only been able to go up to x=
11, and y=7 before running into memory constraints.

items must be able to be added/deleted like in a cart until user
checksout, so no running calculation can take place to try and crunch
numbers as i go. this is why i can't see how array can be made any
smaller.

hope this all makes sense. any ideas to do this in a better way would be
greatly appreciated.


Incidentally, is there any way to initalize all elements in the array to
zero in one fell swoop rather than looping through them?



many thanks tc.
 
G

Greg Beech [MSFT]

I doubt you would have any memory problems until the array reaches a few
thousand in each rank if the values stored are just numbers. In an array
of numbers, the array will automatically be initialized to zero in all
fields by the CLR.

Greg

This posting is provided "AS IS"with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top