|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/30/2007 6:06:51 PM
Posts: 25,
Visits: 36
|
|
| Hello, When I try to return an array with a function it gives me this error, what did I do wrong ? Thanks
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Today @ 9:26:59 AM
Posts: 576,
Visits: 1,254
|
|
| Arrays are not allowed as a return type on a function. However, by default all parameters are passed by reference which means you can edit their contents. Sub IncrementValuesInArray(a() As Integer) Dim x As Long For x = LBound(a) To UBound(a) a(x) = a(x) + 1 Next End Sub Please see the UBound, LBound, ArrayDims, ReDim, and ReDim Preserve areas of E-Basic Help. -Brandon
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/30/2007 6:06:51 PM
Posts: 25,
Visits: 36
|
|
Brandon.Cernicky (7/13/2007)
Arrays are not allowed as a return type on a function. However, by default all parameters are passed by reference which means you can edit their contents. ... -Brandon So I guess this means I can't return an array with a function, but I can pass an array to a function (and sub) and modify its content there. Is this right ? Thanks Brandon !
|
|
|
|