asp数字或者字符排序函数代码
时间:2021-02-07 14:48:08|栏目:ASP代码|点击: 次
复制代码 代码如下:
'排序
Function Sort1(ary)
Dim KeepChecking,I,FirstValue,SecondValue
KeepChecking = TRUE
Do Until KeepChecking = FALSE
KeepChecking = FALSE
For I = 0 to UBound(ary)
If I = UBound(ary) Then Exit For
If ary(I) > ary(I+1) Then
FirstValue = ary(I)
SecondValue = ary(I+1)
ary(I) = SecondValue
ary(I+1) = FirstValue
KeepChecking = TRUE
End If
Next
Loop
Sort1 = ary
End Function
Dim arr
arr = Array("a","c","b")
arr = Sort1(arr)
For i=0 to ubound(arr)
Response.Write(arr(i)&"<br />")
Next
上一篇:asp rs.open sql,conn,3,1中3,1代表什么?
栏 目:ASP代码
下一篇:用javascript编写asp应用--第一课--通览
本文标题:asp数字或者字符排序函数代码
本文地址:http://www.codeinn.net/misctech/58564.html