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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting the directory of a VFP Form

Status
Not open for further replies.

dkean4

Programmer
Feb 15, 2015
282
US
I have been away for too long and I forgot how to detect the directory of a form that is being edited in VFP.

As an example, I have some assets sitting in a directory of a form, and I need to access, from a program running in a different drive. The target form is open for editing in VFP. I thought that the form's directory was expressed in the "Properties" list, somewhere, but I am unable to find it. I seem to remember an object named "VFP" to tap into the Foxpro editing environment. But I just can't remember how to access it.

Please help...


Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Hello Dennis, good to see you hear again.

When you talk about the "directory of the form", do you mean the directory in which the form's file (the SCX) has been saved? If so, there are two ways of doing this:

1. If the form is open in the form designer, click on File / Save As. A File Open dialogue will open, with the directory in question being selected by default. (You don't need to actually save the file.)

2. If the form is in a project, click on it within the Project Manager, then read off the full path and flename at the bottom of the Project Manager window.

Apologies if I have misunderstood the question. If so, perhaps you could clarify it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Is Dennis talking about _VFP properties?

Like _vfp.activeproject.homedir

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
That would need another parameter wouldn't it?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Hi Mike, good to see that you guys are still around. I was thinking about doing it in code, as GriffMG suggested.

GriffMG, thank you, that is exactly what I was thinking. I forgot the underscore in front of VFP... "_VFP". And I also forgot how to reply to your individual posts. So this is a general sweep for all who contributed. You guys are great. Thank you all for being there.


Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Î thought you want the dir of a form, not the project dir.

SYS(1271) works with a running form, to know a path to any project file there is _VFP.ActiveProject.Files, the homedir is not necessarily the directory of all project members.


Chriss
 
I also forgot how to reply to your individual posts

In Tek Tips, unlike in some other forums, you don't reply to individual posts. You reply to the thread as a whole.

Good to say that you've got a solution. Be sure to come back next time you have a problem.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top