asp数字或者字符排序函数代码
更新时间:2011年01月28日 12:33:30 作者:
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
相关文章
asp 动态数组 提供Add、Insert、Remove、RemoveAt、Search等方法。
asp动态数组,提供Add、Insert、Remove、RemoveAt、Search等方法。可以在数组中存储对象不考虑效率问题2009-10-10
ASP中Utf-8与Gb2312编码转换乱码问题的解决方法 页面编码声明
ASP程序在同一个站点中,如果有UTF-8编码的程序,又有GB2312编码的程序时,在浏览UTF-8编码的页面后,再浏览当前网站GB2312的页面,GB2312编码的页面就会出现乱码2012-02-02
asp统计信息实现代码/文章每日、每周、每月、总访问量的方法
asp统计信息/文章每日、每周、每月、总访问量的方法,需要的朋友可以参考下。2011-05-05


最新评论