Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,859 questions

51,780 answers

573 users

How to return two values from a function in VB.NET

2 Answers

0 votes
Imports System
 
Public Module Module1
    Function f() As Tuple(Of Integer, String)
        Return New Tuple(Of Integer, String)(15, "vb.net")
    End Function
 
    Sub Main()
        Dim t As Tuple(Of Integer, String) = f()
		
        Console.WriteLine(t.Item1)
        Console.WriteLine(t.Item2)
    End Sub
End Module
 
 
 
 
' run:
'
' 15
' vb.net
'

 



answered Aug 9, 2019 by avibootz
edited Apr 24, 2024 by avibootz
0 votes
Imports System
 
Public Class Test
    Public Shared Function f(ByRef a As Integer, ByRef b As Integer)
        a = 435
        b = 97
    End Function
     
    Public Shared Sub Main()
        Dim a As Integer
        Dim b As Integer

        f(a, b)
         
        Console.WriteLine("a = {0} b = {1}", a, b)
    End Sub
End Class
 
 
 
' run:
' 
' a = 435 b = 97
'

 



answered Aug 9, 2019 by avibootz

Related questions

2 answers 245 views
4 answers 1,457 views
1 answer 212 views
1 answer 147 views
1 answer 187 views
...