Previous section   Next section

3.6 Statements

In Visual Basic .NET a complete program instruction is called a statement. Programs consist of sequences of Visual Basic .NET statements. Each statement must end with a new line:

Dim x As Integer       ' a statement
x = 23                 ' another statement
Dim y As Integer = x   ' yet another statement

It is possible to combine two (or more) statements on a single line by separating the statements with the colon operator:

Dim x As Integer = 23 : Dim y As Integer = 25

While this is legal, it is uncommon because it makes the code more difficult to read.

A statement that evaluates to a value (e.g., to a Boolean value) is called an expression.


  Previous section   Next section
Top