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 = http://www.

作者: 来源: 时间: 17-11-23 16:04:08

代码如下:
''排序
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 = http://www.popasp.com/ary(I)
SecondValue = http://www.popasp.com/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
11
22
33
隐藏区块

会员注册

本功能为预留功能,暂不支持注册 ^_^

Login

社交帐号登陆

使用以下任意帐号可登陆本站

Close section
Close

联系我们

关于5UCMS 您有任何需求 均可以留言给我们