数组数据排序的程序例子

2018-09-05 23:40

阅读:862

  数组数据排序的程序例子



<%
*** build example array to show that this thing can sort
*** alpha-numeric arrays
Dim MyArray
MyArray = Array(1,5,shawn,says,hello2m骺噃嶤123,12,98)
MyArray = Sort(MyArray)
For I = 0 to Ubound(MyArray)
vbCRLF
Next
Response.End


*** Sorter Function that takes an array and sorts it
Function Sort(ary)
KeepChecking = TRUE
Do Until KeepChecking = FALSE
KeepChecking = FALSE
For I = 0 to UBound(ary)
If I = UBound(ary) Then Exit For
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
%>


评论


亲,登录后才可以留言!