Can Foxpro list "Directory Names" or "Folder Names" to a table?  
Author Message
rpp





PostPosted: Visual FoxPro General, Can Foxpro list "Directory Names" or "Folder Names" to a table? Top

I am trying to produce a list of the sub directories contained within a folder in Windows.

Can I

Is there a foxpro command that allows this functionality to a table or array or something

I am using Visual FoxPro 7.0

Thanks in advance.

Richard Peterson



Visual FoxPro2  
 
 
CetinBasoz





PostPosted: Visual FoxPro General, Can Foxpro list "Directory Names" or "Folder Names" to a table? Top

There is:

ADIR()

Filer.dll that comes with VFP

Scripting.FileSystemObject (aka FSO)

ie: With Adir()

GetTree("c:\My Path")

Function GetTree
lparameters tcPath
create cursor dirlist (dirname m)
=getsubdirs(m.tcPath)
browse

function getsubdirs
lparameters tcPath
local lcCurDir, lnSubDirs, ix
local array laDirs[1]
lcCurdir = ADDBS(m.tcPath)
insert into dirlist values (m.lcCurdir)
lnSubdirs=adir(laDirs,m.lcCurdir+"*.*","DHS")
for ix = 1 to m.lnSubDirs
if laDirs[m.ix,1]#"." AND "D"$laDirs[m.ix,5]
=getsubdirs(m.lcCurdir+laDirs[m.ix,1])
endif
endfor


 
 
rpp





PostPosted: Visual FoxPro General, Can Foxpro list "Directory Names" or "Folder Names" to a table? Top

Thank You.

I can take what you have built and use it, thanks very much.


 
 
yanyee





PostPosted: Visual FoxPro General, Can Foxpro list "Directory Names" or "Folder Names" to a table? Top

here is my coding to list all folders...

SET DEFAULT TO &PcHistpath
LnCnt = Adir(Gcdir,"*.*","D",1)
FOR lnCnt = 1 TO LnCnt
IF "D" $ Gcdir[LnCnt,5]
mHist = gcDir[LnCnt,1]
next

Hope can help ....