Visual Basic: How to pass an array parameter to another routine
| This routine will pass a parameter to another routine | This routine receives the call with array as parameter |
|
Sub TestPassArray()
Dim LongArray(1 To 5) As Long End Sub |
Function PassTest(ByRef LongPass() As Long) As Long
Dim i As Integer
|
- The passing routine packs 1,2,3,4,5 into an array.
- The called routine calculates the sum of all the values in the array and passes the result back to the calling routine.
0 Comments