Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Vbscript Array sort in alphabetical order (See related posts)

// sort vbscript array

<%
dim arrSortOut(8)
arrSortOut(0)="xCount"
arrSortOut(1)="zExec"
arrSortOut(2)="yFinance"
arrSortOut(3)="HR"
arrSortOut(4)="IT "
arrSortOut(5)="!aaaLegal"
arrSortOut(6)="Liberman"
arrSortOut(7)="Martha"
arrSortOut(8)="Regis"

for x=0 to 8
response.write arrSortOut(x)&"<br>"
next

response.write "<br>"

for i = UBound(arrSortOut) - 1 To 0 Step -1
    for j= 0 to i
        if arrSortOut(j)>arrSortOut(j+1) then
            temp=arrSortOut(j+1)
            arrSortOut(j+1)=arrSortOut(j)
            arrSortOut(j)=temp
        end if
    next
next 


for x=0 to 8
response.write arrSortOut(x)&"<br>"
next

%>


You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts