Output parameters with VB .Net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dudi Nissan

    #1

    Output parameters with VB .Net

    Hello,

    I enjoy visiting your web site.
    I am programming with VB .Net
    My code is:
    Public Sub Test(ByVal a As String, ByVal b As String, ByVal c As String)
    a = "aaaa"
    b = "tttt"
    c = "qqqq"
    End Sub

    I have a question:
    I created from this code class library (dll as com object). I would like to
    get a, b, c values when I call this Test function.
    How can this be done? (The syntax in C# is: out string a, out string b)

    Thank you,
    Dudi Nissan.
  • Peter van der Goes

    #2
    Re: Output parameters with VB .Net


    "Dudi Nissan" <DudiNissan@dis cussions.micros oft.com> wrote in message
    news:BE086BA5-A4DC-4AD9-9BBC-7E1270595826@mi crosoft.com...[color=blue]
    > Hello,
    >
    > I enjoy visiting your web site.
    > I am programming with VB .Net
    > My code is:
    > Public Sub Test(ByVal a As String, ByVal b As String, ByVal c As String)
    > a = "aaaa"
    > b = "tttt"
    > c = "qqqq"
    > End Sub
    >
    > I have a question:
    > I created from this code class library (dll as com object). I would like
    > to
    > get a, b, c values when I call this Test function.
    > How can this be done? (The syntax in C# is: out string a, out string b)
    >
    > Thank you,
    > Dudi Nissan.[/color]

    Pass the arguments ByRef instead of ByVal. That way, you'll have access to
    the changed values in the original arguments in the calling code.

    --
    Peter [MVP Visual Developer]
    Jack of all trades, master of none.


    Comment

    Working...