I want to be able to pass in an array, do something with the values in it, and then return a resulting array in a function.
Is there another way to do this without using Variant?
I know this doesn't work but I want it to look something like this: (assuming arr and Test() are the same lengths)
Function Test()(arr() As Integer) As Integer
For i = 0 To UBound(arr)
Test(i) = arr(i) + 1
Next i
End Function
Something like this:
Function AddOne(arr() As Integer) As Integer()
Dim i, rv() As Integer
ReDim rv(LBound(arr) To UBound(arr))
For i = LBound(arr) To UBound(arr)
rv(i) = arr(i) + 1
Next i
AddOne = rv()
End Function
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.