all groups > dotnet academic > january 2004 >
You're in the

dotnet academic

group:

paramarray


paramarray Peter
1/24/2004 7:11:04 AM
dotnet academic: Hi everyone,

In VB6,paramarray parameter is passed using byref,but in VB.NET,using byval.How can I get back the changed value of the paramarray parameter?

My work case in vb.net like this:
-----------------------------------------------------
Function mytestmethod(paramarray byval arg() as object)
arg(0)=12
arg(1)="abc"
End Function

Sub mycalling()
dim a as integer=66
dim b as string="xyz"
mytestmethod (a,b)
msgbox (a)
msgbox (b)
End Sub
-----------------------------------------------------
the expected value of a,b is 12,"abc";but it remains 66 or "xyz".

Who can help me?

Best regards

peter
Re: paramarray Alfred C Thompson II
1/25/2004 1:06:22 PM
I don't think you can use a paramarray with byref. Can you use an overloaded
method that has different numbers of parameters?

Alfred

[quoted text, click to view]

AddThis Social Bookmark Button