Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you determine a files home directory?
Message
From
22/07/1999 22:50:42
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
 
To
22/07/1999 14:24:27
General information
Forum:
Visual FoxPro
Category:
Project manager
Miscellaneous
Thread ID:
00244893
Message ID:
00245146
Views:
17
>Is it possible to query the project manager to determine the full path name of a file included in the project. The project manager does not seem to follow the same rules for locating a file via DEFAULT and PATH that VFP does when running programs, and this fact has bitten me a couple of times.
>
>I use a pretty conventional technique for code development. Keep the working copies of all program files on the server and make local copies of the ones I'm editing. By setting the DEFAULT to my local directory and PATH to the server, VFP uses my test file in place of it's server original and uses the server copies for the rest of the files in the app. (I do not use an automated source control tool).
>
>Problem is, the project manager does not appear to use the same method for file path resolution. It mostly behaves as if it stores the fullpath name when a file is added to the project and then uses that stored name to refind the file. If such a search fails, it then appears to utilize the DEFAULT and PATH to try to find the file, and if it finds it, stores the new full path. I don't like this behavior because it has occasionally caused me to be inadvertently editing the wrong file.
>
>However, I could live with that if there was just some way for me to query the project manager to see the full path name it associates with each file in the project.
>
>What's really strange is that the SAVE AS doesn't help you! If I use the project manager to open up a program file (which happens to only exist on the server) for editing, and DEFAULT is set to my local directory, SAVE AS shows that it will save the file in my local directory. Yet (if I do not actually execute the SAVE AS) if I edit the file and simply SAVE it, the server copy is modified and no local copy is created. Not very friendly if you ask me!
>
>I know I cannot change how the PM behaves so the best I can do is work around it. This would be fairly reasonable to do if I could just query the PM for the fullpath it has associated to a particular file in the project.
>
>Suggestions?

You're right. The PM stores the path to files. Actually, it stores the path relative to the project's home path. This lets you reference common class libraries, procedure files, screens, etc from a folder that was not necessarily in your path.
Rather than try to trick the PM into finding your file, you could:
1. Copy the file to the local drive
2. Remove the file from the Project Manager
3. Add the local file to the PM
Now the PM knows which file you want. Reverse the process when you are finished with the file. By the way, be careful to remove the file from the project and not delete it fom the drive. (That's why I suggest copying the file first, to protect you from a slip of the mouse.)
If you have time, this is the perfect application for a project hook. You could flag a file as "Editing" and when you open it, the code in the project hook would know to open the one on your local drive. I have never done it, but it ought to work.
David.
David.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform