12
The Visual Basic . NET compiler seems to ignore the reserved word Then
, the one at the end of the block If
.
If (1 + 1 = 2) Then
Console.WriteLine("Passou no teste.")
End If
And now, without the Then
:
If (1 + 1 = 2)
Console.WriteLine("Também passou no teste.")
End If
This was the result in the Console:
Passou no teste.
Também passou no teste.
A Keyword Then is it really necessary in Visual Basic . NET? It has a special function or is it some kind of "Improve code reading"?