>What is the syntax for returning a value from an array in a function to an array and will it automatically dimension the array it is returning to ?
If you want to pass an array reference in, modify the array within a function, and have the results persist, you need to pass the array by reference:
DECLARE aSomeArray[4]
aSomeArray = 42
? ALEN(aSomeArray)
? MyFunc(@aSomeArray)
? ALEN(aSomeArray)
? aSomeArray(ALEN(aSomeArray))
FUNCTION MyFunc
LPARAMETER taPassedInArray
LOCAL nOldEntries
nOldEntries = ALEN(taPassedInArray)
DIMENSION taPassedInArray[nOldEntries+1]
taPassedInArray[1] = "I changed the old value"
taPassedInArray[nOldEntries+1] = "and added a new one"
RETURN taPassedInArray[1]