i have a subroutine that looks things up from the nab. the returned variable could either be a scalar value or an array. so my question is if i pass an argument to a sub with an dynamic array reference:
subName (rtrnVal())
is there anything i have to do in the main prog to account for a different return type?
if I get you right you’re trying to pass an argument into a subroutine ByReference, change its value within the routine and then grab the changed value once you’re back in the calling routine (if I didn’t get you right then please forget the rest of this…)
I’d change two things:
use a function instead of a sub: functions are truly designed to return values
functions can’t return arrays, but they can return variants, and variants can be anything (including arrays)
So I’d do something like
function fncSomething(args) as variant
the calling routine would then query the function’s return value for its type, e.g. using something like