请教我这段代码错在哪里?
Private Sub Command2_Click()Dim a(1 To 10) As Integer, i As Integer, t As Integer, j As Integer
Randomize
For i = i To 10 '产生10个随机整数
a(i) = Int(100 * Rnd) '产生10个随机整数
Print a(i); '产生10个随机整数
Next i '产生10个随机整数
For j = 2 To 10
For i = 10 To j Step 1 '一趟排序
If a(i) < a(i - 1) Then '一趟排序
t = a(i) '交换 '一趟排序
a(i) = a(i - 1) '交换 '一趟排序
a(i - 1) = t '交换 '一趟排序
End If '一趟排序
Next i '一趟排序
Next j
Print "排序结果是:"
For i = 1 To 10
Print a(i);
Next i
End Sub