What I want to do is return the values of rows and columns from a function. Here is a dumb example of what I want to do.
I know there are other mabe better ways to make my example work. My actual application is more complex. I need to return rows and columns as values to the caller, where the are they are local varibles. Please copy and paste working code so I can play around with it.
Thank a TON
George
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rows, columns As Integer
Dim whatever As String
whatever = "anything"
rowsAndcolumns(whatever,rows,columns)
MessageBox.Show(rows.ToString)
MessageBox.Show(columns.ToString)
End Sub
Private Function rowsandColumns(ByVal whatEver As String,rows as interger,columns as integer) As Integer
rows = 4
columns = 6
Return (rows ,columns)
'my return generates an error message
End Function
End Class
I know there are other mabe better ways to make my example work. My actual application is more complex. I need to return rows and columns as values to the caller, where the are they are local varibles. Please copy and paste working code so I can play around with it.
Thank a TON
George
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rows, columns As Integer
Dim whatever As String
whatever = "anything"
rowsAndcolumns(whatever,rows,columns)
MessageBox.Show(rows.ToString)
MessageBox.Show(columns.ToString)
End Sub
Private Function rowsandColumns(ByVal whatEver As String,rows as interger,columns as integer) As Integer
rows = 4
columns = 6
Return (rows ,columns)
'my return generates an error message
End Function
End Class