How to i arrange in order numbers like, 1 2 3 4 5

# Thread: How to i arrange in order numbers like, 1 2 3 4 5

1. Senior Member
Join Date
Dec 1969
Posts
540

## How to i arrange in order numbers like, 1 2 3 4 5

How to i arrange in order numbers like, 1 2 3 4 5 6 7 8 9 10 11 ....

2. PB Guest

## RE: How to i arrange in order numbers like, 1 2 3

the number are in a database?<BR>If yes, then you could use an SQL query like:<BR>SELECT * FROM TABLE1 where yourfield ORDER BY ASC (or DESC)

3. Senior Member
Join Date
Dec 1969
Posts
540

## RE: How to i arrange in order numbers like, 1 2 3

No, the number are&#039nt in a database...

4. Senior Member
Join Date
Dec 1969
Posts
487

## ASPFAQ's

There is an excellent FAQ on it:<BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=89<BR><BR>But here&#039s a sample anyway :)<BR><BR>&lt;%<BR>foo= Array(8, 5, 6, 4, 2, 3, 9, 1, 7, 12, 10, 11)<BR><BR>foobar = sortVBArray(fooblah)<BR><BR>Response.Write foobar<BR>%&gt;<BR><BR>&lt;script language=JScript runat=server&#062;<BR> function SortVBArray( arrVBArray ) {<BR> return arrVBArray.toArray().sort(sNumAsc).join(&#039&#03 9);<BR> }<BR><BR><BR>// Sorts records in ascending<BR>// numeric value order<BR>function sNumAsc(a, b) {<BR> return ((+a &#062; +b) ? 1 : ((+a &lt; +b) ? -1 : 0));<BR>}<BR>&lt;/script&gt;

5. Senior Member
Join Date
Dec 1969
Posts
487

## Errata

Ooops,<BR><BR>Replace the line:<BR>foobar = sortVBArray(fooblah) <BR><BR>With:<BR>foobar = sortVBArray(foo) <BR>

#### Posting Permissions

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