Export (0) Print
Expand All

Decision Structures

Visual Basic allows you to test conditions and perform different operations depending on the results of that test. You can test for a condition being true or false, for various values of an expression, or for various exceptions generated when you execute a series of statements. The decision statements supported by Visual Basic include:

  • If...Then
  • If...Then...Else
  • Select...Case
  • Try...Catch...Finally

In This Section

If...Then...Else Statements
Discusses testing one or more Boolean conditions.
Select...Case Statements
Covers testing for different values of the same expression.
Try...Catch...Finally Statements
Explains testing for different exceptions generated by your code.

Related Sections

Loop Structures
Provides an overview of control-flow statements used to repeat processes.
With...End With Statements
Explains how to execute several statements on the same object.
Nested Control Statements
Describes control-flow statements inside other control-flow statements.
Exit Statement
Discusses how to transfer control directly out of a control-flow statement.
© 2014 Microsoft