Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Directory Listing
Message
From
21/01/2000 12:39:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00320966
Message ID:
00321004
Views:
15
>I know how to get a list of Tables into an Array. Is there a similar way to get a list of Directories into an Array, or even into a file?


This is pure fox version thus doesn't access some special folders :
function gettree
Lparameters tcPath
Local lcTopDir
Start=seconds()
lcTopDir = sys(5)+curdir()
Set defa to (tcPath)
Dimension aDirList[1,2]
aDirList[1,1] = tcPath
aDirList[1,2] = "D"
=getsubdirs(lcCurdir)
Set default to (lcTopDir)
? seconds()-start

Create cursor crsDirs ;
  (dirname c(127),attr c(5))
lcCurdir = sys(5)+curdir()
Appe from array aDirList
Browse

Function getsubdirs
Lparameters tcPath
Local lcCurdir, lnSubDirs, ix
Local array laDirs[1]
lnSubDirs=adir(laDirs,tcPath+"*.*","HD")
For ix = 1 to lnSubDirs
  If laDirs[ix,1]#"." and "D"$laDirs[ix,5]
    Dimension aDirList[alen(aDirList,1)+1,2]
    aDirList[alen(aDirList,1),1] = tcPath+laDirs[ix,1]
    aDirList[alen(aDirList,1),2] = tcPath+laDirs[ix,5]
    =getsubdirs(tcPath+laDirs[ix,1]+"\")
  Endif
Endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform