A computer program is a compilation of instructions called statements. There are dozens of statements in Visual Basic (VB) and some—such as If, While, For, and Select Case—are conditional statements that determine the flow of the program. This chapter discusses the more important VB statements.
In programming languages, a statement is an instruction to do something. Statements control the sequence of execution of a program. Assigning a value to a variable is an example of a statement.
x = z + 5
Even a variable declaration is a statement.
Dim rowCount As Long
By contrast, an expression is a combination of operators and operands that gets evaluated. For example, z + 5 is an expression.
Statements can be grouped ...