Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual FoxPro
Expertise: Beginner
Dec 23, 1999

File Locations

Question:
I have set Home as C:\MyApp in Project Information. VFP has no problem finding the project, but when I do a build and, while running, click a link to a form, it wants to look in the VFP directory or, since I put SET DEFAULT TO C:\MyApp in main form Activate code, it wants to look there instead of in: C:\MyApp\Forms. Doesn't VFP know to look in a Forms subdirectory for a form?

I want the application to find each component (form, database, report, etc.) based on setting a single "Application Home Directory" so that when I deploy it to the target PC, I only need to change a single location setting. Is this possible? I want the application to find each component (form,database,report,etc.) based on setting a single 'Application Home Directory' so that when I deploy it to the target PC, I only need to change a single location setting. Possible?

Answer:
You need to use the SET PATH command. When you ask FoxPro for a file without a path in front of it (e.g., DO FORM MyForm vs. DO FORM Forms\MyForm) FoxPro looks in the directories specified in its SET("PATH") setting, which by default is the current directory only. You need to SET PATH to all directories you need access to under C:\MyApp:

 
SET PATH TO C:\Myapp, C:\MyApp\Forms, C:\MyApp\DBF, C:\MyApp\Graphics, ...
Once you have set the default directory (with SET DEFAULT), you don't need to put the full path of subdirectories of C:\MyApp, so the above statement can be simplified to:
 
SET DEFAULT TO C:\MyApps
SET PATH TO Forms, DBF,Graphics, ...
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap