所以我有一個2d數組,我想排序。一維時我可以很容易地排序。 我希望你能幫助我。排序二維數組asp經典
這是我的數據。
top5(0,0) = Greeting
top5(0,1) = 2
top5(1,0) = VerifyingInformation
top5(1,1) = 5
top5(2,0) = Calibration
top5(2,1) = 4
我可以排序它一維時沒有問題。 我正在使用此代碼的一維。
For i = LBound(top5) to UBound(top5)
For j = LBound(top5) to UBound(top5) - 1
If top5(j,1) < top5(j + 1,1) Then
TempValue = top5(j + 1,1)
top5(j + 1,1) = top5(j,1)
top5(j,1) = TempValue
End If
next
Next
我想要的結果就是這個。
VerifyingInformation 5
Calibration 4
Greeting 2
它是正確的,你想根據自己的相關數值,把文本值按降序排列? – nvuono
是的,先生,這是我想要做的。 –