03-09-2005, 08:34 PM
You need to pass the address. Have the function return a pointer. Include crt.bi with your program and use MemCpy to copy the return pointer into the new array.
Code:
TYPE SomeType
ThisField AS LONG
ThisOtherField AS STRING
END TYPE
'For MemCpy
'$Include: "crt.bi"
' Static array for the sake of test, but
' Question would apply to dynamic arrays
' declared like this too.
DIM ThisArray(1 to 100) AS SomeType
DIM Sorted(1 to 100) AS SomeType
' Assuming I have a function I did called SortArray()
MemCpy @Sorted(1), SortArray(ThisArray()), 100 * Len(SomeType)