请教VB问题~

来源:百度知道 编辑:UC知道 时间:2024/06/08 03:54:15
Private Sub Command1_Click()
Dim i As Integer, n As Integer
For i = 0 To 50
i = i + 3
n = n + 1
If i > 10 Then Exit For
Next
Text1.Text = Str(n)
End Sub

Dim i As Integer, n As Integer
For i = 0 To 50
i = i + 3
n = n + 1 '记录循环次数
If i > 10 Then Exit For 'i>10时跳出循环,i的值只能为3,6,9
Next
Text1.Text = Str(n) 'n=3

3