File Locations

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:MyAppForms. 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 FormsMyForm) 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:MyAppForms, C:MyAppDBF, C:MyAppGraphics, ...

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:MyAppsSET PATH TO Forms, DBF,Graphics, ...

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved