vb6 - Naming Optional Parameters in Visual Basic -


In Visual Basic, I have work with several alternative arguments. I want to be able to pass some of these alternative arguments into the function without using many commas and spaces to reach those options. Somewhere I saw the way the parameter name like OptVar: = val , but it does not seem to work just by thinking that there is a way to do this. This will help in readability

  function foo (optional val1 = 1, optional val2 = 2, optional val3 = 3) last function  

foo To use the only the final argument of this type is required:

  fud = foo (, 4)  

slightly It would be better if it was done in such a way:

  fud = foo (val3: = 4)  

but it does not work is. It actually works:

  function foo (optional val1 =   

"val1: 1 val2: 2 val3: 4" and each other will be output as a first message box foo (val3: = 4) end sub

Returned with foo: 4


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -