Comparison Operators

Visual Basic supports several operators that do not perform math. Instead, these comparison operators compare one data value to another. One value can be greater than, equal to, or less than the other value. With comparison operators, you can write programs that make decisions at runtime.

All comparison operators produce true or false results. In other words, the comparison is either true or the comparison is false. The rest of your code uses the result of this comparison to determine what to do next. For example, if a comparison returns a false value when determining whether an employee worked during a pay period, the rest of the program knows not to print a paycheck for the employee.

Table 7.5 describes the six comparison ...

Get Absolute Beginner's Guide to Programming, Third 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.