loop through inconsecutive numbers

# Thread: loop through inconsecutive numbers

1. Dan
Senior Member
Join Date
Dec 1969
Posts
1,364

## loop through inconsecutive numbers

i need to loop through an inconsecutive loop of numbers... like<BR><BR>3,4,5,10,43, etc...<BR><BR>how do i do this ? there is no pattern to the numbers, they will probably even be out of order.

2. Senior Member
Join Date
Dec 1969
Posts
3,921

## Well..

&#060;%<BR><BR> dim nCnt<BR> dim nTot<BR> dim sArray<BR> dim sVal<BR><BR> sVal = "1,2,5,10,12,22"<BR><BR> sArray = Split(sVal,",")<BR> nTot = Ubound(sArray)<BR><BR> for nCnt = 0 to nTot<BR> response.write sArray(nCnt) <BR> next<BR><BR>%&#062;

3. Senior Member
Join Date
Dec 1969
Posts
1,431

## What??

are the numbers in an array? What is the purpose of the code, how are the numbers generated.<BR><BR>if in an array eg myArr<BR><BR>then<BR><BR>For i = 0 to ubound(myArr)<BR>Response.Write myArr(i)<BR>Next

4. Fiancé Guest

## put them in an array

for (i = 0; i &#060; numberOfNumbersInArray; i++){<BR> nextInt = arrayOfNumbers[i]; //use next int instead of i in the loop... <BR>}<BR><BR>Jason<BR>http://www.jasontconnell.com

5. Fiancé Guest

## woops

i wrongly assumed javascript.. sometimes, with all the non-ASP questions, i forget that this is an ASP forum!!<BR><BR>Jason<BR>http://www.jasontconnell.com

6. Senior Member
Join Date
Dec 1969
Posts
202

## Fiance, eh?

Did you get engaged over the weekend?

7. Fiancé Guest

## Yup! eop

.

8. Senior Member
Join Date
Dec 1969
Posts
474

## Hey, congatulations !

You finally decided to take the plunge.<BR><BR>Do you have a date set ?

9. Fiancé Guest

## RE: Hey, congatulations !

I wouldn&#039;t say Finally!! (i&#039;m only 22) But thank you very much... we&#039;re thinking sometime in middle 2003, probably summer. Nothing exact yet. <BR><BR>Jason<BR>http://www.jasontconnell.com

10. jule Guest

## RE: Hey, congatulations !

congratulations !

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•