Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find project files in drive C:
Message
 
 
To
11/03/2014 09:17:44
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01596053
Message ID:
01596098
Views:
52
>>>>>>>Thor has a fantastic new tool called Finder which can be used to find the files when you know their name.
>>>>>>
>>>>>>If only I knew their names.
>>>>>
>>>>>Did you try to check pjx file as a table? It should have location to the files.
>>>>
>>>>I did open .pjx with USE (if this is what you mean by "check") and found no indication of where the files are located. The name column of the .pjx has the name of the file but no location.
>>>
>>>I have relative paths in the Name column.
>>
>>For some files I do see a relative path but for others only name. And even relative path is not quite enough for me. Because I used to have this project on C: drive in the same folder name as now I have it on D: drive. So path like ..\MyFolder\MyFile.prg does not tell me where the file is. And for those files where name simply says MyFile.jpg, it does not help at all. Of course, I can do a search for each and every file but that would take too much time.
>
>If the file is on the same drive as the project, you get a relative, but if it's on another drive, you should get a full path. Easy enough to distinguish those in code.
>
>FWIW, I'd do it with the Project and File objects rather than USE.
>
>
>MODIFY PROJECT YourProject NOWAIT
>oProj = _VFP.ActiveProject
>
>FOR EACH oFile IN oProj.Files
>  cFileName = oFile.Name
>  cDrive = JUSTDRIVE(m.cFileName)
>  IF NOT EMPTY(m.cDrive)
>     * Stored on another drive
>  ENDIF
>ENDFOR
>
>
>Tamar

Even though - in my project - some files that are on the same drive as the project have absolute path (including the drive), your code is very helpful. I can just "look" for drive "c:" in the cFileName.
Thank you very much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform