I think the confusion comes from 3
. We'd think that 3
and 4
should behave the same. In fact, 3
is equivalent to this:
If 3 = 3 Then: (do nothing) 'an empty statement
Debug.Print 3 ' <-- This will be executed regardless of the previous If condition
To see it, change 3
into this:
If 3 = 0 Then:
Debug.Print 3 '<-- 3 will be printed! ;)
In conclusion, yes, the :
is indeed to merge many statements on a single line
Good job @Vityata !!! :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…