Web Hosting Talk







View Full Version : ASP Loop or Array


hurrikane
12-18-2002, 05:43 PM
Is there a what to out put a loop as a full array. (I don't know if I am explaining the terms correctly but I will demostrate what I want.)


This is the loop I have:

i = 1
count = 0

Do while count < 10
chartMoney(i) = 10 * i
chartTime(i) = i
count = count + 1
i = i + 1
loop
count = 0

What I want to do is rather than it actually doing the loop I want to out put the data or store it.


chartMoney(1) = 10 * 1
chartTime(1) = 1

chartMoney(2) = 10 * 2
chartTime(2) = 1

chartMoney(3) = 10 * 3
chartTime(3) = 3

and so on!

Is there a way to do that instead of the actual loop?

MarkIL
12-18-2002, 05:49 PM
Umm, cant you just insert the equivalent of "print" before "loop"?

E.G.,

Do while(count < 10)
.. whatever ..
response.write(data);
loop

Disclaimer: I'm not an ASP guru, nor a user of any MS products.

willisg
12-18-2002, 07:39 PM
you have the data stored in those 2 arrays so you can output it or store it anytime after the loop is finished.

or you can output it or store it (in db?) each time inside the loop.

response.write chartMoney(i)