Reputation: 2939
I came across some sample code in VB.Net which I have some experience with and kinda having a duh moment figuring out the meaning of :=.
RefreshNavigationImages(bForward:=True, startIndex:=-1)
The sig for this method is RefreshNavigationImages(boolean, int). Is this a default value if null? Like "bIsSomething ?? false"?
Tried to bing/google but they just don't like searching for operators especially if it's only 2 chars.
Upvotes: 2
Views: 414
Reputation: 185623
The :=
indicates the use of named parameters. Rather than relying on the order of the parameters in the method declaration, named parameters allow you to specify the correlation of parameters to values by specifying the name of the parameter.
Upvotes: 5
Reputation: 86064
They are named parameters. They let you specify values for arguments in function calls by name rather than order.
Upvotes: 12