"Alexandre Moura" <amoura@online.microsoft.com> wrote in message
news:MBYsAy$nDHA.2624@cpmsftngxa06.phx.gbl...
> There is no easy workaround that I know of - however, you can still use a
> paramarray and obtain the values back if you use the following trick:
>
> Module Module1
>
> Sub Main()
> Dim i As Integer = 4
> Dim s As String = "123"
> Dim obj() As Object = New Object() {i, s}
> foo(obj)
> i = obj(0)
> s = obj(1)
>
> Console.WriteLine(i)
> Console.WriteLine(s)
> End Sub
>
> Sub foo(ByVal ParamArray arg() As Object)
> arg(0) = 1
> arg(1) = "abc"
> End Sub
>
> End Module
>
> this code calls a method taking a paramarray by creating the array in
> advance - the method changes the array member's values, and it recovers
> them to the original variables - this code prints 1 then "abc".
>
> Hope that helps.
>
> --------------------
> >From: "DonKolafa" <DJKolafa@msn.com>
> >Subject: ByRef ParamArray alternative
> >Date: Mon, 27 Oct 2003 11:26:46 -0800
> >Lines: 22
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> >Message-ID: <OdBZFBMnDHA.1488@TK2MSFTNGP12.phx.gbl>
> >Newsgroups: microsoft.public.dotnet.languages.vb.upgrade
> >NNTP-Posting-Host: dialup-67.25.254.164.dial1.losangeles1.level3.net
> 67.25.254.164
> >Path:
>
cpmsftngxa06.phx.gbl!cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.
> phx.gbl
> >Xref: cpmsftngxa06.phx.gbl
> microsoft.public.dotnet.languages.vb.upgrade:5680
> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb.upgrade
> >
> >Is anyone aware of a reasonable syntax or procedural substitute for the
> >'ByRef ParamArray' of VB6. It may seem a trivial change to 'ByVal
> >ParamArray' in VB.NET, but if you have a very large number of parameters,
> >that you wish to change....you are up a creek.
> >
> >My specific problem is emulating a Business Basic READ statement where
the
> >calling program simply supplies a list of variables, and the physical
file
> >read routine parses them into the various variables. My VB6 version of
> this
> >product works because of the ByRef ParamArray:
> >
> >bbREAD 7,bbIO("KEY=" & K$,"ERR=A05511"), A$, B$, Y, Z, Null, Null, N
> >
> >is properly interpreted by declaring
> >
> >Public Sub bbREAD(Unit as Integer, IOParms as String, ParamArray Parms()
as
> >Variant)
> >
> >Don Kolafa
> >Don@Kolafa.com
> >
www.Kolafa.com > >
> >
> >
>