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次,不太明白。

原文地址:https://www.cnblogs.com/jiangkeji/p/4059433.html