Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

HomeDir

This project property contains the home directory of the project. In the Project Info dialog, it shows as “Home:”. The home directory of a project is used as the base for relative paths stored with the project’s files.

Usage

prjProject.HomeDir = cPath
cPath = prjProject.HomeDir

The name of each file in a project (available via the Name property of the File object) includes the path to the file. Any file that comes from the same drive as the project is stored with a relative path (though it’s displayed with an absolute path). When the project is processed in any way, those paths are considered to be relative to the home directory. (That is, the path uses the . and .. notations to show how you get from the home directory to the directory containing this file. Files on other drives have absolute paths containing the drive and full directory hierarchy down to the file.) This means that you mess with HomeDir at your own risk, since changing it is likely to wreak havoc on your next build.

Example

* Report the home directory of the current project
? "Home directory = ",Application.ActiveProject.HomeDir

See Also

File, Name, Project