所以我有一个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
是的,先生,这是我想要做的。 –