28,391
社区成员
发帖
与我相关
我的任务
分享
<%
set rs=conn.execute("SELECT SortName FROM [sort] ORDER BY SortName")
if rs.eof then
response.write("xxx!")
response.end
end if
dim s1,s2,s3,s4,s5
do while not rs.eof
data=rs(0)
temp=hdler(data)
if temp>="a" and hdler<="h" then
if s1="" then s1=data else s1=s1&","&data
else if temp>="i" and hdler<="l" then
if s2="" then s2=data else s2=s2&","&data
else if temp>="m" and hdler<="n" then
if s3="" then s3=data else s3=s3&","&data
else if temp>="o" and hdler<="r" then
if s4="" then s4=data else s4=s4&","&data
else if temp>="s" and hdler<="z" then
if s5="" then s5=data else s5=s5&","&data
end if
rs.movenext
loop
rs.close: set rs=nothing
a1=split(s1,",")
a2=split(s2,",")
a3=split(s3,",")
a4=split(s4,",")
a5=split(s5,",")
call renderHTML(a1,1)
call renderHTML(a2,2)
call renderHTML(a3,3)
call renderHTML(a4,4)
call renderHTML(a5,5)
function renderHTML(arr,n)
s="<div id='div"&n&"'><ul>"
for k=0 to ubound(arr)
s=s&"<li>"&arr(k)&"</li>"
next
s=s&"</ul></div>"
response.write s
end function
function hdler(s)
hdler=lcase(left(s,1))
end function
%>