Output parameters with VB .Net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Dudi Nissan said:
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.

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.
 

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

Back
Top