What does the following mean?
Class.Function(variable := 1 + 1)
What is this operator called, and what does it do?
= operator assigns a value either as a part of the SET statement or as a part of the SET clause in an UPDATE statement, in any other case = operator is interpreted as a comparison operator. On the other hand, := operator assigns a value and it is never interpreted as a comparison operator.
Visual Basic provides the following types of operators: Arithmetic Operators perform familiar calculations on numeric values, including shifting their bit patterns. Comparison Operators compare two expressions and return a Boolean value representing the result of the comparison.
Comparison Operators. Logical/Bitwise Operators. Bit Shift Operators. Assignment Operators.
It is used to assign optional variables, without assigning the previous ones.
sub test(optional a as string = "", optional b as string = "")
msgbox(a & b)
end sub
you can now do
test(b:= "blaat")
'in stead of
test("", "blaat")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With