Arrays as function arguments

mattgy

New member
Joined
Jan 2, 2005
Messages
1
Programming Experience
Beginner
In VBScript I can do something like this:

call myfunction(array("hello","world"))

myfunction(aArray)
...
...
end function

How can you do the same thing with VB.net, without having to declare/initialise the array first?

Regards.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
You'll always have to initialize the array first, just as you did in VBScript by using array("hello","world").
One example of the .NET syntax would be:
VB.NET:
myfunction(New String() {"hello", "world"})
 
Top Bottom