Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SubDirectory List
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00282489
Message ID:
00282658
Views:
19
Hi Bill,

Here's a recursive example to get you started:
dime aDirList(1)
=tree("C:\")

*
* tree.prg
*
lparam cDir
private x, aFolders, nDir

aDirList(alen(aDirList)) = cDir
dime aDirList(alen(aDirList)+1)

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))
	endif
next x
return
If speed is a concern, you may be better off using the FileSystemObject as mentioned by Ed.

>What is the best way to get an array of all sub directories for a particular directory. I need subdirectories of subdirectories as well.
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform