Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does "ELSE : " compile in vb.net?

Why does this compile?

If Months > 1 Then

    Label.Text = Months + " Months"

Else : Months = 1

    Label.Text = Months + " Month"

End If

Using Visual Studio 2010.

like image 551
user1502753 Avatar asked Jul 05 '12 01:07

user1502753


1 Answers

: is a line separator. It's equivalent to a newline:

If Months > 1 Then

    Label.Text = Months + " Months"

Else

    Months = 1
    Label.Text = Months + " Month"

End If

And here's the best documentation I could find. Sorry.

like image 97
Ry- Avatar answered Sep 19 '22 08:09

Ry-