Function Sort(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
Sort = ary
End Function
dim ID,ArrayID,Myarray,M
ID="55,48,78,10,90"
ArrayID=split(ID,",")
Myarray=Sort(ArrayID)
'排序测试
For M=0 To Ubound(Myarray)
Response.Write Myarray(M) & "<br>" & vbCRLF
Next
'当然也可以用下面的,
Dim Myarray
Myarray=Array(12,10,25,78,45)
Myarray=Sort(ArrayID)
'排序测试
For M=0 To Ubound(Myarray)
Response.Write Myarray(M) & "<br>" & vbCRLF
Next
'排序测试