加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

asp数字或许字符排序函数代码

发布时间:2023-05-08 12:52:43 所属栏目:Asp教程 来源:
导读:asp数字或许字符排序函数代码: 代码如下:'排序Function Sort1(ary)Dim KeepChecking,I,FirstValue,SecondValueKeepChecking = TRUEDo Until KeepChecking = FALSEKeepChecking = FALSEFor I = 0 to UBound(ary)

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 = 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

(编辑:银川站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章