I'm new to Vb-script and I have to create a function (keyword) which needs a big number of param but using Optional parameters is not allowed in Vb-script.
I did some web research and I noticed that I can use argument array or objects dictionary. I want to know in which case it is preferred to use argument array and when I have to use Dictionary. Also, is it easy to add param to my function arguments in each case ?
I would recommend creating a class for all your parameters, and pass a single instance of that class. It's a bad design to have methods with a large number of parameters, and if you use an array, it's less robust because you'll always have to count to figure out which index your param is at. With a class, all your "parameters" will be named fields or properties.
Here's a simple example of what I'm talking about: