Click to See Complete Forum and Search --> : Passing an array as a parameter in a subroutine


Raptors Fan
June 15th, 2001, 04:20 PM
Hi,

Can someone please show me how I can pass an array as a parameter in a subroutine or function.

Thanks,

RF

Ghost308
June 15th, 2001, 04:26 PM
Let's say you have a function that calculates an average, you would define the function like this...

Public Function Average(Array()) As Long

Be sure you put those parentheses where necessary. When you make a call to that function, you'll want to send it an array of numbers that are to be averaged. If that array is X() then a call to the function would go...

Text1.Text = Average(X)