版主帮我看下
用下面这个排序函数
最后排的为什么9必20要大?它好像只排第一位的数字的,这个函数是不是有问题啊?
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
我是这样调用的
dim paixu
paixu=myarray
paixu=sort(paixu)
[此贴子已经被作者于2005-8-15 15:32:35编辑过]