Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

/= Operator

Divides the value of a variable by the value of an expression and assigns the result to the variable.

variable /= expression

Parts

variable
Required. Any numeric variable.
expression
Required. Any numeric expression.

Remarks

This statement assigns a Double to the variable on the left hand side. If Option Strict is On, variable must be a Double. If Option Strict is Off, an implicit conversion will be made and the resultant value assigned to variable, with a possible error at run time. For more information, see Widening and Narrowing Conversions, and Option Strict Statement.

Example

The following example uses the /= operator to divide one Integer variable by a second and assign the quotient to the first variable.

Dim var1 As Integer = 12
Dim var2 As Integer = 3
var1 /= var2   ' The value of var1 is now 4.

See Also

&= Operator | *= Operator | += Operator | -= Operator | / Operator | = Operator | \= Operator | ^= Operator | Assignment Operators | Arithmetic Operators | Operator Precedence in Visual Basic | Operators Listed by Functionality | Assignment Statements

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.