Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21174

Can a Function return an Array

$
0
0
I have several functions that need to return an Arrays.

Can this be done without having the array as a ByRef argument in the argument list

'How I do it now:

Code:

Private Sub SomeSub()
  '
  '
 Dim MyArray(10) As Integer
 
 UpdateArray MyArray
  '
  '
End Sub
  '
  '
  '
Private Function UpdateArray(ByRef CallersArray() As Integer) As Integer
  '
  '
  '
End Function


Something how I would like to do it:

Code:

Private Sub SomeSub()
  '
  '
 Dim MyArray(10) As Integer
 
 MyArray = UpdateArray()
  '
  '
End Sub
  '
  '
  '
Private Function UpdateArray() As Integer()
  '
  '
  '
End Function


Viewing all articles
Browse latest Browse all 21174

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>