博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
数组数据排序的程序例子(转)
阅读量:2496 次
发布时间:2019-05-11

本文共 862 字,大约阅读时间需要 2 分钟。

'*** build example array to show that this thing can sort
'*** alpha-numeric arrays
Dim MyArray
MyArray = Array(1,5,"shawn","says","hello",123,12,98)
MyArray = Sort(MyArray)
For I = 0 to Ubound(MyArray)
  Response.Write MyArray(I) & "
" & 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
%>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10294527/viewspace-124728/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10294527/viewspace-124728/

你可能感兴趣的文章
spring boot jpa 实现拦截器
查看>>
jenkins + maven+ gitlab 自动化部署
查看>>
Pull Request流程
查看>>
Lambda 表达式
查看>>
函数式数据处理(一)--流
查看>>
java 流使用
查看>>
java 用流收集数据
查看>>
java并行流
查看>>
CompletableFuture 组合式异步编程
查看>>
mysql查询某一个字段是否包含中文字符
查看>>
Java中equals和==的区别
查看>>
JVM内存管理及GC机制
查看>>
Java:按值传递还是按引用传递详细解说
查看>>
Java中Synchronized的用法
查看>>
阻塞队列
查看>>
linux的基础知识
查看>>
接口技术原理
查看>>
五大串口的基本原理
查看>>
PCB设计技巧与注意事项
查看>>
linux进程之间通讯常用信号
查看>>