[RESOLVED] How to Get 2 Return values in one Function...
Hello Superiors.
i want to get two output values in one Function is't possible ?.
i am just using String data type and split the values.
but have any other easy way to get two output values...
actually i want to checking a folder how many jpg files are Horizontal and vertical
so
Code:
Public Funtion HVChecking() as string
Dim HCount%, VCount%
''
''
''
''
Return HCount.ToString & "|" & VCount.ToString
End Function
finally i split the values with "|" character...
have any other options to get two values as separate in one functions .....
i have no moew idea about Dictionary, HashTable.....which one is best for this....
Thanks........
Re: How to Get 2 Return values in one Function...
You can return two or more values from a function by creating a Structure and let the function return it, like this example
vb Code:
Public Class Form1
Private Structure sCount
Public HCount As String
Public VCount As String
End Structure
Private Function HVChecking() As sCount
Dim s As sCount
'
'
'
s.HCount = "90"
s.VCount = "80"
Return s
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As sCount = HVChecking()
Me.Text = s.HCount & " --- " & s.VCount
End Sub
End Class