About the colon in VB, to many people's impression is: "A line can write a few sentences." That's right, but there is one situation that is not right, that is, in the conditional statement. This is to do a VB project upgrade when encountered, because this problem I checked a good long time program, has been looking for VB in the effect is how to achieve it? Now I find that's a very big bug. I think this is not a programmer's error, it should be a VB syntax loopholes. If there is no understanding of the place to welcome everyone to advise.
Let's look at an example:
1 If Row1 =-1 Then Row1 = 0:if Row2 =-1 Then Row2 =. MaxRows
Our general understanding is to execute the first if statement and then execute the second statement, which should look like this:
If Row1 =-1 Then Row1 = 0
If Row2 =-1 Then Row2 =. MaxRows
But it's not, in fact, in the form below. Such a form is not the result we want.
If Row1 =-1 Then
Row1 = 0
If Row2 =-1 Then Row2 =. MaxRows
End If
I think this syntax for people who are unfamiliar with VB code porting should be a very hidden bug. Hope to be able to help everyone.
This is only my personal opinion, if there are different views of the Welcome to communicate together!
The colon--bug in VB