O'Reilly logo

Visual Basic 2005 Jumpstart by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators

VB 2005 supports the various operators shown in Table 2-2.

Table 2-2. Operators supported in VB 2005

Type

Language element

Description

Arithmetic

^

Raises to the power of

 

Subtraction

 

*

Multiplication

 

/

Division

 

\

Integer Division

 

Mod

Modulus (remainder)

 

+

Addition

Assignment

=

Assigns a value to a variable or property

 

^=

Raises the value of a variable to the power of an expression and assigns the result back to the variable (new in VB 2005)

 

*=

Multiplies the value of a variable by the value of an expression and assigns the result to the variable (new in VB 2005)

 

/=

Divides the value of a variable by the value of an expression and assigns the result to the variable (new in VB 2005)

 

\=

Divides the value of a variable by the value of an expression and assigns the integer result to the variable (new in VB 2005)

 

+=

Adds the value of an expression to the value of a variable and assigns the result to the variable (works for strings as well) (new in VB 2005)

 

-=

Subtracts the value of an expression from the value of a variable and assigns the result to the variable (new in VB 2005)

 

&=

Concatenates a String expression to a String variable and assigns the result to the variable (new in VB 2005)

Comparison

=

Equal

 

<>

Not equal to

 

<

Less than

 

>

Greater than

 

<=

Less than or equal to

 

>=

Greater than or equal to

 

Like

Compares a string against a pattern

 

Is

Compares two object reference variables

 

IsNot

Compares two ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required