>>>>>I might well use this because it's more flexible (if I actually used arrays much anymore :), but how about using AINS, getting loop size from ALEN?
>>>>
>>>>Sure, but I'm pretty certain that, with large arrays at least, the constant redimensioning, AINS() and population of array members would be slower than simply appending into a temporary cursor and spitting out the end result with a SQL Select. And the cursor is certainly easier to sort or filter, too.
>>>
>>>Yes, could be a size issue at some point...well, this goes back to what I was saying last week, I guess, that cursors are more flexible than arrays, and are better for most situations. And if you need to do temporary array manipulation with cursors, why not just use cursors, period? :)
>>
>>'Cause I can't get ADIR() to spit straight into a cursor?
>
>Couldn't you also just use ACOPY? You do have to re-size your destination array to hold all the elements first, but then just tell it where the "new" elements are to start in the array.
I've tried, and this seems to work; obviously, you have to treat everything as a one-dimensional array in ACOPY to get them to match up, and I still think that the cursor solution is better, if for no reason other than it won't break with a large number of rows (if you end up with 13,107 entries, an array can't possibly do it, and that number is reduced further by variables and names currently in use by VFP) and sorting and filtering the set is much easier with the cursor as well:
DIMENSION aFile1[1,5], aFile2[1,5]
nRows1 = ADIR(aFile1,'A*.*')
nRows2 = ADIR(aFile2,'M*.*')
DIMENSION aFile1[nRows1+nRows2,5]
? ACOPY(aFile2,aFile1,1,-1,(nRows1 * 5) + 1)