Private Sub Command1_Click() Dim i, n As Integer For i = 0 To 50 i = i + 3 n = n + 1 If i > 13 Then

exit fornexttext1.text=str(n)end sub为什么文本框最后的结果是3而不是4
2024-11-27 18:52:55
推荐回答(2个)
回答1:

神人,这样也能提问.很马虎的一个人

Private Sub Command1_Click()
Dim i, n As Integer
For i = 0 To 50
i = i + 3
n = n + 1
If i > 13 Then
Exit For
End If
Next
Text1.Text = Str(n)
End Sub

结果是4,请复制后再试

回答2:

for循环i变量每次也要+1的
也就是说i每次要+4