>Hi William,
>
>>Beautiful, worked like a champ. I wasn't passing by reference, that did it. BTW, nice job on emulating the C notation for arg passing. I'd like to see arguments passed into a VFP exe work like C does, nargs and arglist[]. Thanks again.
>
>Thanks for the kind words. I think you'll find it a fairly fast routine. I ran some tests (in the development environment) at home using a P200 (pity me< g >) with 64 Mb and a 13 gig hard drive with 3,700+ directories. Took a shade over 30 seconds to recurse the entire tree. I seem to recall, however, that Cetin Basoz did a similar test using the FileSystemObject and that it was marginally faster. I don't, however, remember all the details.
Just ran the FSO version on a pretty busy NT box (PII-400, 128MB, a web browser, vfp, the msdn running), took 2.672 - 5.906 seconds per run (these were the high and low values respectively) for a tree with 965 subdirs:
SET PROC TO FSOTree
nLowTime = 10000000
nHighTime = 0
cStartDir = 'C:\'
FOR I = 1 TO 100
DIMENSION aDirArray[1]
nStartup = Seconds()
=GetTreeUsingFSO(@aDirArray,cStartDir)
nFinish = seconds()
nLowTime = MIN(nLowTime, nFinish - nStart)
nHighTime = MAX(nHighTime, nFinish - nStart)
ENDFOR
? nLowTime, nHighTime