>clear all >set escape on >start=seconds() >*start1 = start >create cursor dirs (dirname c(254)) >insert into dirs values ("c:\") >*browse nowait >*dimension dirs[1] >*dirs[1]="c:\" >=subdirs("c:\") >? seconds()-start > >function subdirs >lparameters cDir >cDir = cDir+iif(right(cDir,1)="\","","\") >local aSubdirs, ix >dimension aSubdirs[1,1] >nCount = adir(aSubdirs,cDir+"*.*","DHS") >asort(aSubdirs) >*local ix >for ix = 1 to m.nCount > if aSubdirs[m.ix,1]#"." and "D"$aSubdirs[m.ix,5] >* dimension dirs[alen(dirs)+1] >* dirs[alen(dirs)]=cDir+aSubdirs[m.ix,1] >* =subdirs(dirs[alen(dirs)]) > insert into dirs values (cDir+aSubdirs[m.ix,1]) >* if seconds()-start1 >= 1 && Show what's going on app once per min >* start1 = seconds() >* show window (wontop()) refresh >* endif > =subdirs(trim(dirs.dirname)) > endif >endfor >>First to my surprise there wasn't much difference between doing to a cursor and array (under 1 sec and of course liked it). Also showing the user what's going on with above "if" or "if reccount()%20 (or 50)" slowed down less than 1.7 secs. My machine K6-200 with 64Mb RAM, 1465 directories. The results were changing by CPU load however (no change in method lasts between 23 - 34 secs). UT was online all the time and whenever the test hit refresh of UT (60 secs set) it slowed down to 34 secs. In between it lasted 23-24 secs. I think it'll be faster if I cut all my network and disable TCPIP. Not bad especially when user see what's going on (seems 50-65 dirs are processed per sec). I'm newbie to win32api and was disappointed to see that VFP no longer supports "load-call xxx.bin". I was doing assembly stuff for hw and speed gain. Now everything is "?CX" or "?LL"ed. I don't think API would make it faster but not sure. Also I think time would change depending on defragmentation, dir