当前位置: 移动技术网 > IT编程>开发语言>Asp > asp数字或者字符排序函数代码

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

2017年12月08日  | 移动技术网IT编程  | 我要评论
复制代码 代码如下:

'排序
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

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网