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!

RETURNING A DIRECTORY PROGRAMMATICALLY 1

Status
Not open for further replies.

Maricus

Programmer
Mar 9, 2001
41
0
0
KE

Hi guys,

First, I wish to thank you all for the helpful hints I normally get through this forum.

I have two questions which have never had a solution: I using fox26aDOS.

1. want to check if a certain entered directory exists
2. How can I return the name of the same directory.

I would to use these in creating an installation/setup program that update the installation path in a setup dbf. This path will be useful in a lot of functions later.

Maricus
 
Maricus-

Try "VALIDPATH("Pth")" from "FoxTools". "Pth" should be the full path, including filename, you are testing.

 
Maricus, Ricks reply from 9.march is sufficient.
But i not understand, why you install into
user defined directory - its too complicated.
Simply use your own directory from root -
for example SYS(5)+"\maricus\...."
 
FredIsleib,
Thanks for your reply.

How can I get Foxtools


==========================
Tesar,

I am sorry I had to bring this again. The raeson being that, considering your reply, the directory specified is assumed to be non-existent. What would happend if it already exists. Error (202) refers Invalid path/ file name

Can an ON ERROR() help here. e.g if on error function return 202 then Directory was invalid...? How about already exists dir?

Maricus
 
Marius,
FoxTools.FLL comes with all Windows versions of FoxPro. You should be able to find it at sys(2004)+"foxtools.fll". The code I usually use to open it looks something like:

IF !("FOXTOOLS.FLL" $ set("LIBRARY"))
&& assume it's where it should have been installed !
lcfptfll = sys(2004)+"foxtools.fll"
lcfptfll = locfile(lcfptfll, "FLL", "Where is FOXTOOLS.FLL?")
IF EMPTY(lcfptfll))
WAIT WINDOW "Can't run without FOXTOOLS.FLL" TIMEOUT 30
RETURN
ENDIF
SET library to (lcfptfll) ADDITIVE
RELEASE lcfptfll
ENDIF


Rick
 
Obviously, there have been very helpful hints here.

However, my solution lies in using foxtools.fll. Is there a downloadable one for Fox 2.6a DOS.

Maricus
 
Maricus,
I guess I should have tried to answer based on the original question rather than concentrating on the most recent "thread". While there are no Foxtools for FPD2.6a, you will find most of the same functions in the MS supplied FPATH.PLB.

If you replace "FOXTOOLS.FLL" with "FPATH.PLB" in my code above, you'll get the equivalent version for FPD.

If after you do SET LIBRARY TO sys(2004)+"FPATH.PLB", do a DISPLAY STATUS, and you see all the functions included in this library. The usage for most of them should be "obvious", but if you have any specific question(s), I'd suggest you just start a new thread.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top