Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alphabetic order of an array?

Status
Not open for further replies.

FranckM

Programmer
May 8, 2002
76
CA
Is it possible to list the contents of an array in alphabetic order? I mean is there a simple way of donig this?
 
just change the script tags to go server side
<html>
<head>
<script language=&quot;VBScript&quot;>
sub arrayalfa()
Dim Arrlist(15)
count = 15
Arrlist(0) = &quot;anna&quot;
Arrlist(1) = &quot;gouri&quot;
Arrlist(2) = &quot;ramu&quot;
Arrlist(3) = &quot;shree&quot;
Arrlist(4) = &quot;leela&quot;
Arrlist(5) = &quot;kanna&quot;
Arrlist(6) = &quot;ranga&quot;
Arrlist(7) = &quot;honey&quot;
Arrlist(8) = &quot;sweety&quot;
Arrlist(9) = &quot;sungandh&quot;
Arrlist(10) = &quot;tara&quot;
Arrlist(11) = &quot;nita&quot;
Arrlist(12) = &quot;preeti&quot;
Arrlist(13) = &quot;thimma&quot;
Arrlist(14) = &quot;lata&quot;

Arralphabets = &quot;a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z&quot;

arralphabets = split(Arralphabets,&quot;,&quot;,-1,1)

for each alphabets in arralphabets
for i = 0 to count
if left(Arrlist(i),1) = alphabets then
if check <> alphabets then
alert ucase(alphabets)
end if
alert Arrlist(i) & vbCr
check = alphabets
end if
next
next
end sub
</script>
</head>
<body onLoad=&quot;arrayalfa()&quot;>
</body>
</html> [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top