Compartilhar via


Referencing Modifiable Files

When you compile a project into an application, files included in the project are assembled into a single application file. After the project is built, files in the project that are marked "included" become read-only.

Often, files that are part of your project, such as tables, are intended to be modified by users. In those cases, you should add the files to your project but mark them as excluded. Excluded files are still part of your application, so Visual FoxPro still tracks them as part of your project, but they are not compiled in the application file, so users can update them.

Note   Tables are marked as excluded by default, because Visual FoxPro assumes that tables will be modifiable in an application.

As a general rule, files containing executable programs (forms, reports, queries, menus, and programs) should be included in the application file, and data files should be excluded. However, you should determine whether to include or exclude files based on your application requirements. For example, a table that contains sensitive system information or information used only for lookup can be included in the application file to protect it from inadvertent change. Conversely, you might exclude a report (.frx) file if your application allows users to change it dynamically.

If you exclude a file, you must make sure that Visual FoxPro can find the excluded file when the application runs. For example, when a form references a visual class library, the form stores a relative path to that library. If you include the library in the project, it is made part of the application file, and the form will always be able to locate the library. However, if you exclude the library, the form must search for the library using the relative path or the Visual FoxPro search path (as set using the SET PATH command). If the library is not in the expected locations — for example, if you have moved the library since creating the form — Visual FoxPro displays a dialog box asking the user to locate the library. You might not want users to see this dialog box. To be safe, include all files that don't need to be updated by users.

Note   You cannot include application (.app) files, and you should choose to exclude library files (.ocx, .fll, and .dll).

To exclude modifiable files

  1. In the Project Manager, select the modifiable file.

  2. From the Project menu, choose Exclude.

    If the file is already excluded, the Exclude command is not available; the Include command appears in its place.

Excluded files have the symbol to the left of their names.

Note   Files marked as main files cannot be marked as excluded. For details about main files, see Setting the Starting Point.

Tip   To view all project files at once, choose Project Info from the Project menu and select the Files tab.

See Also

Adding Files to a Project | Compiling an Application | SET PATH | Project Manager