数组数据排序的程序例子
程序员文章站
2022-05-09 20:54:58
数组数据排序的程序例子 <% *** build example array to show that this thing can sort *** alpha-numer...
数组数据排序的程序例子
<%
*** build example array to show that this thing can sort
*** alpha-numeric arrays
dim myarray
myarray = array(1,5,"shawn","says","hello"2m骺噃嶤123,12,98)
myarray = sort(myarray)
for i = 0 to ubound(myarray)
response.write myarray(i) & "<br>" & vbcrlf
next
response.end
*** sorter function that takes an array and sorts it
function sort(ary)
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
sort = ary
end function
%>
<%
*** build example array to show that this thing can sort
*** alpha-numeric arrays
dim myarray
myarray = array(1,5,"shawn","says","hello"2m骺噃嶤123,12,98)
myarray = sort(myarray)
for i = 0 to ubound(myarray)
response.write myarray(i) & "<br>" & vbcrlf
next
response.end
*** sorter function that takes an array and sorts it
function sort(ary)
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
sort = ary
end function
%>
上一篇: 金国灭亡时,南宋是怎么对待金国的?
下一篇: 全文本检索的应用(1)
推荐阅读
-
php中将数组转成字符串并保存到数据库中的函数代码_php技巧
-
php多数据库支持的应用程序设计第1/2页_php技巧
-
CI框架AR操作(数组形式)实现插入多条sql数据的方法,ciar
-
获取表单提交的数据转为数组给后台
-
第4章 数据处理-php数组的处理-郑阿奇_php入门_脚本之家
-
php数组排序之ksort-对数组的元素键名进行升序排序
-
python 读取.csv文件数据到数组(矩阵)的实例讲解
-
小程序自定义组件——创建和使用自定义组件步骤 & 自定义组件属性properties数据列表、data数据、methods方法的用法
-
提高MySQL数据库查询效率的几个技巧[php程序员必看]
-
返回基地 php用数组返回无限分类的列表数据的代码