Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR() to get directories
Message
From
08/12/2003 15:27:15
 
 
To
08/12/2003 15:10:00
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00856932
Message ID:
00856940
Views:
14
I use the FileSystemObject for this.
e.g.
** assuming an array is still needed
lcFolder="c:\test"
lnCurr=1
loFSO=CreateObject("scripting.filesystemobject")
loFol=loFSO.GetFolder(lcFolder)
Dimension laSubs(loFol.SubFolders.Count)
For Each loSub In loFol.SubFolders
  laSubs[lnCurr]=loSub.Name && or loSub.Path if you want the full path
  lnCurr=lnCurr+1
Next
Display Memory Like laSubs
It also makes it much easier to do recursive calls to get full sub-trees.


>Using VFP8.
>
>I am trying to get a list of sub-directories from a passed in directory. The following works fine except when a sub-directory contains a dot in it's name.
>
>
>***This will capture all directories in c:\test\ EXCEPT for
>***directories named like this:
>***c:\test\10.2.0.1\
>***c:\test\12.1.3.4\
>***etc..
>
>=ADIR(myarray, [C:\test\*.], "D")
>DISPLAY MEMORY LIKE myarray
>
>
>Is there a better way to capture all sub-directories or a way to get every sub-directory in a folder?
>
>Thanks,
>
>Jerry
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform