Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting directory

Status
Not open for further replies.

oversight

Programmer
Mar 11, 2004
10
0
0
AR
Hello.
I'd like to know to make a routine to select a directory from a dialog box. There's a function called GETFILE, but only works for selecting a file within a directory. I need something like this but without selecting any file.

I also need a compiler so that I can run .PRG just like a .exe from DOS.

Thank you

 
Unfortunately, my FoxPro version 1.02 doesn't support GETDIR() command.
 
Actually, using FP 2.0 (much the same as 1.02), I don't think it would be too hard to make a screen that is similar to the one for GETFILE(). The hard part is getting the directory info from the underlying OS - especially if you are running under any 32-bit OSs that have long file names. DOS 8.3 makes things much simpler.

You could use the DOS Dir command to pipe the info to a text file, then parse it. It looks like:
Code:
DIR c:\ /AD /X /S
for each drive would give you the raw data to load up the cursors for the controls. You'd have to decide when and how much data to gather to keep the user happy - it won't be as instananeous as GETFILE() is.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top