Dim Loop 出现结果不同

(1)结果是:循环1次

Dim counter,num
counter = 0
'num = 9
Do Until num = 10
    num = num - 1
    counter = counter + 1
    If num<8 Then Exit DO    
Loop 
Msgbox "循环了" & counter & "次"

 

(2)结果是:循环2次

Dim counter,num
counter = 0
num = 9
Do Until num = 10
    num = num - 1
    counter = counter + 1
    If num<8 Then Exit DO    
Loop 
Msgbox "循环了" & counter & "次"

 

总结:第二个结果是循环2次,我明白; 第一个结果为什么是循环1次,不太明白。

 

posted @ 2014-10-29 14:26  Jenny测试开发  阅读(190)  评论(0编辑  收藏  举报