'排序
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
如对本文有疑问,
点击进行留言回复!!
网友评论