Logical Operators


The following table summarizes the Visual Basic logical operators.

Open table as spreadsheet

Operator

Purpose

Example

Result

Not

Logical or bitwise negation

Not A

True if A is false

And

Logical or bitwise And

A And B

True if A and B are both true

Or

Logical or bitwise Or

A Or B

True if A or B or both are true

Xor

Logical or bitwise exclusive Or

A Xor B

True if A or B but not both is true

AndAlso

Logical or bitwise And with short-circuit evaluation

A AndAlso B

True if A and B are both true

OrElse

Logical or bitwise Or with short-circuit evaluation

A OrElse B

True if A or B or both are true




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net