There is a single assignment operator in VB.
Dim value = 5
Notes
Watch out for assignment vs. equality comparison.
Dim result = leftValue = rightValue
In this example you can see the equal sign being used as both a comparison operator and an assignment operator, unlike other languages. In this case, result
will be of type Boolean
and will contain the value of the equality comparison between leftValue
and rightValue
.
Related: Using Option Strict On to declare variables properly