Brent Site Admin
Joined: 01 Jul 2005 Posts: 793
|
Posted: Sep 16th, 2014, 6:11pm Post subject: Experiment - Passing arguments by name |
|
|
The most recent release of VF adds the ability to pass arguments by explicitly providing the names of the parameters. You do this by typing the name enclosed inside square brackets ([]) and following it with the expression you are passing to the procedure. You may optionally separate the name and expression with an equals sign (=).
For example, given the following: Code: | Sub Test arg1, Optional arg2, arg3
' whatever
End Sub |
- You can call it normally:
Call Test 1, 2, 3
- You can leave an argument empty:
Call Test 1, , 3
- You can give it explicit arguments:
Call Test [arg1]1, [arg2]2, [arg3]3
- You can re-arrange the arguments:
Call Test [arg3]3, [arg2]2, [arg1]1
- You can make a mixture:
Call Test 1, [arg3]=3
_________________ Brent |
|