Visual Basic .NET/Assignation and comparison operators

Assignment
The "=" operator is used for assignment. The operator also serves as a comparison operator (see Comparison).


 * To set values:

You can use variables in the equal operator, as well.

Comparison
The "=" operator is used for comparison. The operator also serves as a assignation operator (see Assignment).


 * To compare values:

You can use variables in the equal operator, as well.

Let's try a slightly more advanced operation.

You will get an error if you try to assign a constant or a literal a value, such as 7 = 2. You can compare 7 and 2, but the answer will always be False.

In the case of two equal operators appearing in a statement, such as

The second equal operator will be processed first, comparing 2 and 7, giving a False. Then the first equal operator will be processed, assigning False to x.

More Comparison Operators
(x less than y), (x more than y), (x not equal to y), (x less than or equal y) & (x greater than or equal to y)

Note the way round the operators are on the last two, putting them the other way round is not valid.

Visual Basic .NET/Assignation et comparaison