asp数字或者字符排序函数代码
asp数字或者字符排序函数代码
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:'排序FunctionSort1(ary)DimKeepChecking,I,FirstValue,SecondValue...

复制代码 代码如下:

'排序

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教程学习
热门ASP教程学习
编程开发子分类