Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SubDirectory List
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00282489
Message ID:
00282658
Vues:
18
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

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform