3.7. Decision Making: Equality and Relational Operators

This section introduces Visual Basic’s If...Then statement, which allows a program to make a decision based on the truth or falsity of some expression. The expression in an If...Then statement is called a condition. If the condition is met (i.e., the condition is true), the statement in the If...Then statement’s body executes. If the condition is not met (i.e., the condition is false), the body statement is not executed. Conditions in If...Then statements can be formed by using the equality operators and relational operators (also called comparison operators), which are summarized in Fig. 3.21. The relational and equality operators all have the same level of precedence and associate from ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, 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.