What is := in VB.net
-
Well, subject tells everything ... I can't find what := does in VB.NET ... Here's one example ... SwitchDesktop(hDesktop:=p_lngHwnd) Can anyone tell me ? thanks :)
[Message Deleted]
-
Well, subject tells everything ... I can't find what := does in VB.NET ... Here's one example ... SwitchDesktop(hDesktop:=p_lngHwnd) Can anyone tell me ? thanks :)
This might be able to help you[^]. It is also possible that, that is VB6 syntax.
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my Blog
-
[Message Deleted]
-
This might be able to help you[^]. It is also possible that, that is VB6 syntax.
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my Blog
-
Well, subject tells everything ... I can't find what := does in VB.NET ... Here's one example ... SwitchDesktop(hDesktop:=p_lngHwnd) Can anyone tell me ? thanks :)
It's for named parameters. For example:
Sub ShowMsg(ByVal a as String, ByVal b as String, ByVal c as String)
MsgBox(a & b & c)
End SubSub Main()
'Notice how a, b, and c are out of order.
ShowMsg(c := "!", b := " World", a := "Hello")
End Sub -
Well, subject tells everything ... I can't find what := does in VB.NET ... Here's one example ... SwitchDesktop(hDesktop:=p_lngHwnd) Can anyone tell me ? thanks :)
Unless I am mistaken, := allows you to pass variables by name vs. by position (example below is freehand). Example sub: sub test (byval Value1 as string, byval Value2 as integer, byval Value3 as object) Normal way to call by position: Call sub test("value1", 2, new object) call by name: Call sub test(Value3:= New object, Value2:=2, Value3:="doh!") Generally you see the := used in attributes.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
-
It's for named parameters. For example:
Sub ShowMsg(ByVal a as String, ByVal b as String, ByVal c as String)
MsgBox(a & b & c)
End SubSub Main()
'Notice how a, b, and c are out of order.
ShowMsg(c := "!", b := " World", a := "Hello")
End Sub -
Unless I am mistaken, := allows you to pass variables by name vs. by position (example below is freehand). Example sub: sub test (byval Value1 as string, byval Value2 as integer, byval Value3 as object) Normal way to call by position: Call sub test("value1", 2, new object) call by name: Call sub test(Value3:= New object, Value2:=2, Value3:="doh!") Generally you see the := used in attributes.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
-
Well, subject tells everything ... I can't find what := does in VB.NET ... Here's one example ... SwitchDesktop(hDesktop:=p_lngHwnd) Can anyone tell me ? thanks :)
you can use it to assign values like you did in that function call...say some of those are optional and you want to assign directly to the variable name..
-- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)
-
Well, subject tells everything ... I can't find what := does in VB.NET ... Here's one example ... SwitchDesktop(hDesktop:=p_lngHwnd) Can anyone tell me ? thanks :)