01
'排序
02
Function
Sort1(ary)
03
Dim
KeepChecking,I,FirstValue,SecondValue
04
KeepChecking = TRUE
05
Do
Until
KeepChecking = FALSE
06
KeepChecking = FALSE
07
For
I = 0 to UBound(ary)
08
If
I = UBound(ary)
Then
Exit
For
09
If
ary(I) > ary(I+1)
Then
10
FirstValue = ary(I)
11
SecondValue = ary(I+1)
12
ary(I) = SecondValue
13
ary(I+1) = FirstValue
14
KeepChecking = TRUE
15
End
If
16
Next
17
Loop
18
Sort1 = ary
19
End
Function
(鼠標移到代碼上去,在代碼的頂部會出現四個圖標,第一個是查看源代碼,第二個是復制代碼,第三個是打印代碼,第四個是幫助)使用方法:
vIEw source