I don't have VFP7 so I can't test for answer to my question.
After you run myFunc(), are aTemp and aTest separate arrays or separate references to the same array? In case I've phrased that badly, if you modify an element of aTemp, will that have any affect on aTest and vice-versa?
Thanks.....Rich
>>In VFP7, you can return an object's array from an object's method, but you can't do that from a plain old .PRG style function.
>
>You can but such arrays must be in scope after the call. The only way to achive that is to use PUBLIC array. Here's a code
PUBLIC aTest[1]
>aTemp = myFunc()
>?aTemp[1], aTemp[2], aTemp[3], aTemp[4], aTemp[5]
>
>FUNCTION myFunc
>DIMENSION aTest[5]
>aTest[1] = "Some"
>aTest[2] = " values"
>aTest[3] = " can"
>aTest[4] = " be"
>aTest[5] = " returned"
>RETURN @aTest
>