Changes

Visual Basic Flow Control

No change in size, 16:03, 15 January 2008
no edit summary
In [[Visual Basic Comparison and Logic]] we looked at how to use Visual Basic logical expressions to decide is if something is ''True'' or ''False''. Much of the art of programming involves writing code that makes decisions based on one or more criteria. Such decisions define which code gets executed and which code gets by-passed when the application is running. This is often referred to as ''flow control'' since it controls the flow of execution.
In previous chapters the ''If'' statement has been widely used in examples. In this chapter of Visual Basic Essentials we are going to cover the various forms of ''If'' statements such as ''If .. Then .. Else'', together with other decision making code structures such as ''Select Case'' and ''GoTo''
== Using If ... Then .. Else to Make Decisions ==
The next variation of ''If'' statement allows us to also specify some code to perform if the expression in the ''If'' statement evaluates to '"'False''. The syntax for this construct is as follows:
'''If''' ''expression'' '''Then'''