# Visual Basic: Private Function with multiple parameters



## Heart845 (Jan 7, 2009)

I wanna have a function with more than one variable, and the function supports an infinite amount of variables, as in it requires one variable but can take 3 or 4 or 5 and the function will run for each instance of the one variable.
Example:

Private Function dFunc (ByVal x As Integer)

Except I can call it using 2 or more variables too, like
dFunc(1)
dFunc(1,2,3,4)
dFunc(1,4,61)

And it will run the script for each instance of the variable.

Thanks in advance!


----------



## JimmySeal (Sep 25, 2007)

Sounds like what you want is a ParamArray:

http://msdn.microsoft.com/en-us/library/9z7h91e4(VS.80).aspx
http://articles.techrepublic.com.com/5100-10878_11-5845727.html
http://www.programmers-corner.com/viewSource.php/246


----------

