Using If…Then…Else in Visual Basic

To control the program flow in Visual Basic 6, we can use various conditional operators. Basically, they resemble mathematical  operators. Conditional operators are very powerful tools, they let the Visual Basic 6 program compares data values and then decide what action to take, whether to execute a program or terminate the program and more.  Some of the conditional operators are +, -, >, < ,>= and <=.

On top of the conditional operators,  there are a few logical operators which offer added power to the Visual Basic programs. They are And, Or, Xor and Not.  To effectively control the Visual Basic program flow, we shall use the If…Then…Else statement together with the conditional operators and logical operators.

Read more about conditional and logical operators and the usage of If….Then.. Else in our newly updated and enhanced Visual Basic 6 Lesson 7.