In the following function I build a 5 by 2 array. the syntax is
[code]
function alpha( code)
dim ancestors(5,2)
(code)
dim result(11)
result(8) = code
result(9) = ancestors
result(10) = code
alpha = result
end function
sub
dim ancestors5(5,2)
alpha_result = alpha( code )
ancestors5(5,2) = alpha_result(9)
end sub
[/code]
An even simpler code is as follows:
function alpha(code) as variant
dim arr(5,2)
result(1) = arr
result(2) = something_else
alpha = arr
end function
sub
dim arr2(5,2)
call = alpha(code)
arr2(5,2) = call(1)
end sub
temp =
As you can see from the screen shots there is definitely something in the alpha_result(9) array but it is not getting passed on to the ancestors5 array.


dim ancestors(5,2)actually creates a 6x3 array, since the default lbound is zero, and you're declaring the ubounds as 5 and 2. So you get 0-5 and 0-2. Would be useful to update your question with a compilable example of the problem: right now it's pretty hard to follow. Youralphafunction doesn't return anything for example...alpha_result(9), that's not how it's done in VBA