求助 。下标越界
下标越界了 i,j 都是int
For i = 2 To 8
temp.Caption = lbl(2, i).Caption
j = i - 1
While temp.Caption < lbl(2, j).Caption //下标越界。。。
lbl(2, j + 1).Caption = lbl(2, j).Caption
j = j - 1
Wend
lbl(2, j + 1).Caption = temp.Caption
Next i
另:模块 为
Public a(8) As Integer
Public lbl(1 To 2, 1 To 8) As Label
Public s As Double
Public pause1 As Boolean
[解决办法]
For i = 2 To 8
temp.Caption = lbl(2, i).Caption
j = i - 1
Do While (i > 0)
If (temp.Caption < lbl(2, j).Caption) Then
lbl(2, j + 1).Caption = lbl(2, j).Caption
Else
Exit Do
End If
j = j - 1
Wend
lbl(2, j + 1).Caption = temp.Caption
Next i