Chapter 3- Data Types and Operators Boolean Expressions Page 2 3 4

Introduction

The If Statement Page 2 3 4 5 6 7 8 9
Arithmetic Operations Page 2 3 4 5 6 Boolean Operators and Nested If Statements Page 2 3 4 5 6 7
Events and Sequential Processing Page 2 3 4 5 More Examples Page 2 3 4 5 6 7 8 9 10 11 12
Datatypes and Conversions Page 2 3 4 5 6 7 Using Check Box and Option Controls Page 2 3 4 5 6 7 8 9 10
Variable Declarations - Local and Global Page 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Exercises Page 2 3 4 5 6 7 8
Chapter 4- Selection Statements Review Questions
Introduction

4-2: Boolean Expressions

Equality versus Assignment

You may have noticed that the = operator does double duty. Up until now it has meant "assign a value to a variable" but now we have just seen that it may also mean "compare one value to another to see if those values are equal". Many computer languages use different operators to distinguish these two meanings. Sometimes the comparison operator is == for example. Visual Basic relies on context to determine which operation is required, but sometimes this can be confusing. For example, what does

varOne = varTwo = varThree

mean? Or rather under what circumstances might such a statement be valid?