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:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may