首页 > Linux操作系统 > Linux操作系统 > 数组数据排序的程序例子(转)
'*** 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
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
%>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10294527/viewspace-124728/ ,如需转载,请注明出处,否则将追究法律责任。