In Visual Basic, I have functions with a lot of optional arguments. I would like to be able to pass just a few of these optional arguments to a function without having to use numerous commas and spaces to get to the ones I want. Somewhere I saw a way to named params such as OptVar:=val, but that does not seem to work. Just wondering if there is a way to do this. This would help readability.
Function foo(Optional val1 = 1, Optional val2 = 2, Optional val3 = 3) End Function To use foo with only the last arg needed like this:
fud = foo( , , 4) is a little unwieldy. It would be better if a construct like this worked:
fud = foo(val3:=4) But this does not work.