I can't find any information online or under the Operator documentation, but I've seen this ":=" used a few times in VB.NET and I can't work out what it does.
It's used for named parameters (ht to SLaks for the link) in a method call and is usually used with optional arguments.
It's usually useful for calling Word or Excel methods through ActiveX calls, where there are an awful lot of optional arguments, most of which are never used.
Example
Private Function test(arg1 As Integer, arg2 As Integer) As Boolean
Debug.WriteLine("{0} {1}", arg1, arg2)
Return True
End Function
These two will both produce the same result
test(arg2:=2, arg1:=1)
test(1, 2)
Debug output
1 2
1 2
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