MickeC
asked on
Array from loop
Hi!
I have a simple problem with arrays.
I want to build an array of a loop, then i want to store the result in a variable.
I have a loop like this:
while not rsSpare.eof
response.write rsSpare("SupportProcessSpa repart")&" "
rsSpare.movenext
wend
And if there is more than one sparepart then i want to seperate them with an break and then i want to store this in a variable named spareparts and the output will be:
sparepart1
sparepart2
...
I will use the variable in an mailcomponent. Can you help me, i know that this is basic, but i am in a hurry and i am really bad at arrays :-)
I have a simple problem with arrays.
I want to build an array of a loop, then i want to store the result in a variable.
I have a loop like this:
while not rsSpare.eof
response.write rsSpare("SupportProcessSpa
rsSpare.movenext
wend
And if there is more than one sparepart then i want to seperate them with an break and then i want to store this in a variable named spareparts and the output will be:
sparepart1
sparepart2
...
I will use the variable in an mailcomponent. Can you help me, i know that this is basic, but i am in a hurry and i am really bad at arrays :-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In this example, I merely loop through the numbers 1 through 10.
Open in new window
Using your rsSpare object, it would look like this:
Open in new window
A little bit cleaner, but I'm not sure if I have the syntax correct for rsSpare.Index, would be something like this (not sure if the first value is 0 or 1 - if it is 1, then you will want to subtract 1 from it so that the first item in your array is number 0:
Open in new window