Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function overloading/Args() array - Is there a solution?

Status
Not open for further replies.

joelwenzel

Programmer
Jun 28, 2002
448
In some languages, it is possible to get an argument array of a function and access parameters through the array. Is it possible to access this array in vbscript?

Perhaps there are other solutions to my problem. I want to create a function that can be called with a different number of variables each time it is called. In C, function overloading could solve my problem. In vbscript, I could pass an array as the argument but it would have to contain all the same type (wouldn't it? I want to pass a recordset, string, and ints).


I want to be able to call the function like this

call foobar(string1, recordset1)
call foobar(string1)

and have the function handle the data differently depending on the number of parameters. I would also be happy with

call foobar(array1) if the array could contain different datatypes
 
ASP.NET, and subsequently, C# or VB.NET is your solution. They are full OO languages and support (among other things) overloaded method calls.

If you have programmed in OO languages before, then making the move is a piece of cake. I hate to be harsh on a technology that I grew to love with years of development, but ASP classic is a rag when compared to .NET.

penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top