首页上一页 1 下一页尾页 1 条记录 1/1页
为什么缺少ELSE也能运行?
发表在VB答疑区
2014-08-22
是否精华
是
否
版块置顶:
是
否
Private Sub Command1_Click()
Dim i As Long, j As Long, b As Long
For i = 1 To 9
For j = 0 To 9 - i
If a(j) > a(j + 1) Then
b = a(j)
a(j) = a(j + 1)
a(j + 1) = b
End If
Next j
Next i
For i = 0 To 9
Text1.Text = Text1.Text + CStr(a(i)) + " "
If i = 4 Then Text1.Text = Text1.Text + Chr(13) + Chr(10)
Next i
End Sub
这只是一个片段
Dim i As Long, j As Long, b As Long
For i = 1 To 9
For j = 0 To 9 - i
If a(j) > a(j + 1) Then
b = a(j)
a(j) = a(j + 1)
a(j + 1) = b
End If
Next j
Next i
For i = 0 To 9
Text1.Text = Text1.Text + CStr(a(i)) + " "
If i = 4 Then Text1.Text = Text1.Text + Chr(13) + Chr(10)
Next i
End Sub
这只是一个片段