Issue of paramarray

G

Guest

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) as objec
arg(0)=1
arg(1)="abc
dim revalue as object="somevalue
return revalue
End Functio

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

Who can help me

Best regard

To
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top