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
.
Get Programming Visual Basic .NET, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.