You were kind enough to permit empty arrays to be returned with RET_ARRAY, which is simplifying my code enormously.
There is, however, an edge case that still causes problems: if you return an empty array that you set equal to an array that isn't empty. Here's some code that reproduces it:
BEGIN "This throws an install-time-error" DESIGNATED 0
OUTER_SPRINT $array1(0) "minsc"
DEFINE_ACTION_FUNCTION fn
RET_ARRAY array2
BEGIN
END
LAF fn RET_ARRAY array1=array2 END
BEGIN "This doesn't" DESIGNATED 1
DEFINE_ACTION_FUNCTION fn
RET_ARRAY array2
BEGIN
END
LAF fn RET_ARRAY array1=array2 END
BEGIN "Nor does this" DESIGNATED 2
OUTER_SPRINT $array1(0) "minsc"
DEFINE_ACTION_FUNCTION fn
RET_ARRAY array2
BEGIN
OUTER_SET $array2("whocares")=1
END
LAF fn RET_ARRAY array1=array2 END
In the first block, fn returns an empty array 'array2', and it's then set to 'array1' in the function call. That returns 'unknown return value: array2_0'. It doesn't occur if I put something in array2 within the function, or if I set it to a new array in the function call. I assume this is unintentional.