Kind of.
Basically, in your function definition, you can give some variable default parameters, like this:
Notice the " = 1" assignment in the function definition. This means that if you call the function without specifying a second parameter, it will use the value 1 as the second parameter. If you do specify it, it will be whatever you sent. Here's a working code example:
So, as you can see, it's kind of a "variable" number of parameters, though it's not truly, since all parameters are specified one way or another, just not necessarily by you.
Note that if you have a function with default parameters, every parameter after the first default parameter must also have a default parameter. That is to say, this will not work:
Dig it?
Basically, in your function definition, you can give some variable default parameters, like this:
Function PrintLines(Message$, howmany% = 1) ...
Notice the " = 1" assignment in the function definition. This means that if you call the function without specifying a second parameter, it will use the value 1 as the second parameter. If you do specify it, it will be whatever you sent. Here's a working code example:
PrintLines("Hello") PrintLines("Echo", 5) Function PrintLines(Message$, howmany% = 1) For i% = 1 To Abs(howmany) Print Message Next End Function
So, as you can see, it's kind of a "variable" number of parameters, though it's not truly, since all parameters are specified one way or another, just not necessarily by you.
Note that if you have a function with default parameters, every parameter after the first default parameter must also have a default parameter. That is to say, this will not work:
Function PrintLines(Message$="", howmany%) ; <--- WON'T WORK ...
Dig it?