新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_Click() Dim i%, n% For i = 1 To 5 Debug.Assert i <> 3 Debug.Print i Next End Sub
运行结果:
1 2
断点停在Debug.Assert的行,按F8和F5继续:
3 4 5