>>Does anyone know how to return an array or an object reference from within a method or function or procedure?
>>
>>The folowing code is an example of what does not seem to work:
>>
>>FUNCTION Start
>>DIMESION aTest(2)
>>aTest[1] = 1
>>aTest[2] = 2
>>*--- CALL TO PROCEDURE TO RETURN ARRAY
>>aTest2 = RetArray(aTest)
>>
>>? aTest2[1]
>>? aTest2[2]
>>RETURN
>>
>>FUNCTION RetArray(aRry)
>>aRry[1] = aRry[1] + 1
>>aRry[2] = aRry[2] - 2
>>RETURN aRry
>>
>>
>>
>>*--- THE CODE ABOVE DOES NOT RETURN AN ARRAY. It returns what looks to be the first element in the array.
>>
>>Anyone know how to do this?!!!!
>>
>>
>>.
>
>pass the array by reference. =RetArray(@aTest) will do what you're looking for...
>> Surely, passing by reference resolves the problem. But the consistent (object-oriented) way is to create property-array and handle it throughout all its scope not to worry about passing to methods,procedures etc.
Edward Pikman
Independent Consultant