CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    78

    Passing an array as a parameter in a subroutine

    Hi,

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

    Thanks,

    RF


  2. #2
    Join Date
    Jun 2001
    Location
    Memphis, TN
    Posts
    146

    Re: Passing an array as a parameter in a subroutine

    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)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured