Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dir command and full file names
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00756815
Message ID:
00756828
Views:
10
How do I get the context of say the c:\ directory, say all files, into a text file using the adir() command? I have never used it.

You'll get a list of files in an array. It's easier to work with array than file.
DIMENSION laList[1]
lcDir = "C:\"
lnFiles = ADIR(laList, lcDir + "*.*")
VFP help is a good place to get details about ADIR() function.


>Alternatively, is there a way to make the following, stop asking me to select a folder each time I run it?

Pass directory you wand as a parameter to GetFolder method.
>	local oFSO, oFolder, oFile
>  clear
  lcDir = "C:\"
>  oFSO = crea('Scripting.FileSystemObject')
  oFolder = oFSO.GetFolder(lcDir)
>  for each oFile in oFolder.Files
>    ?oFile.Name
> next
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform