Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH and Subfolders of Subfolders
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00224547
Message ID:
00224966
Views:
18
Hiya Patric,

I haven't run a comparison for speed, but you can apply the same recursive tecnique using ADir() as well:
*
* tree.prg
*
lparam cDir
private x, aFolders, nDir

?cDir

if right(cDir,1) # '\'
	cDir = cDir + '\'
endif

nDir = aDir(aFolders, cDir + "*.*", "D")
for x = 1 to nDir
	if 'D' $ aFolders(x,5) and aFolders(x,1) # '.'
		=tree(cDir + aFolders(x,1))
	else
		? cDir + aFolders(x,1) 
	endif
next x
return
>So far I've been able to improve speed a little using WSH and pouring the results of what I'm doing into a table, but I really wish ADIR() worked as advertised. (I've NEVER been able to get info contained more than one subfolder deep, even when using the D switch with ADIR().)
>
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform