Reputation: 11401
I have a C# function call which looks something like this:
var res = function ("arg1", // argument# 1
"arg2", // argument# 2
"arg3" // argument# 3
);
the list of arguments is around 25 or so. It's a Web Services function, which I have no control over.
I'm trying to port it to VB.NET for another application and was wondering if VB.NET will let me call a function in this manner (with comments, if possible)?
Upvotes: 3
Views: 5211
Reputation: 545618
FYI, the next version of VB will let you write the call like this:
Dim res = function("arg1",
"arg2",
"arg3"
)
I.e. without underscores to continue the lines.
Upvotes: 7
Reputation: 815
Dim res = function("arg1", _
"arg2", _
"arg3" _
)
Will work, however you can't add comments to each line, as the _
character has to be the last character on the line.
Upvotes: 12
Reputation: 11299
It will not. You can use the built-in XML comments to add comments to the function declaration. In VS simply type "'''" above the function and it will automatically generate a comment body for you to fill out.
If you want to list your parameters on a function call in that way, you can use the line continuation character "_" following each parameter to list the function parameters.
Upvotes: 0