[AccessD] Function Return array?

MartyConnelly martyconnelly at shaw.ca
Fri Feb 6 10:22:43 CST 2004


Or you can pass by reference

Public Sub Test1()

Dim aryTest1(1 To 3) As Integer
Dim i As Integer

For i = 1 To 3 Step 1
    aryTest1(i) = i
    Debug.Print aryTest1(i)
Next i

Call Test2(aryTest1())

For i = 1 To 3 Step 1
    Debug.Print aryTest1(i)
Next i

End Sub


Public Sub Test2(ByRef aryTest2() As Integer)

Dim i As Integer
Dim j As Integer
Dim k As Integer

j = LBound(aryTest2)
k = UBound(aryTest2)

For i = j To k
    aryTest2(i) = i * 2
    Debug.Print aryTest2(i)
Next i

End Sub


S D wrote:

>Hi group,
> 
>I have  a function that builds an array. Is it possible to let the function return the array?
> 
>Any ideas?
> 
>TIA
>Sander
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Finance: Get your refund fast by filing online
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada





More information about the AccessD mailing list