O'Reilly logo

ASP.NET by Example by Steven A. Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Statements

In VB.NET, statements represent executable code. The next section outlines the statements found and VB.NET and their usage.

Blocks

A block statement allows multiple statements to be written in contexts where a single statement is allowed. A block statement consists of a statement list enclosed by braces:

Sub Main

End Sub

Statement Lists

A statement list is simply one or more statements written in sequence and enclosed in blocks as outlined following:

Sub Main
    Refresh()
    Repaint()
End Sub

Labeled

A labeled statement allows a statement to be referenced by a Goto statement. The scope of the label is the block that encloses it, including any nested blocks:

Sub Main
    If (X>0) Then Goto MyLabel
    X = X + 1
    MyLabel:
        return X
End Sub

Declarations ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required