PRB: "File does not exist" Using Macro Substitution in EXE

ID: Q132696

The information in this article applies to:

SYMPTOMS

Running an .EXE file on the development machine works, but when that .EXE file is moved out of the development directory or onto another machine, the customer encounters the error "File <filename> does not exist." While investigating the error, it is found that the file was never brought into the project by the Project Manager, so file is missing from the .EXE file.

CAUSE

In any case where macro substitution is used in a command expression that makes a call to another file, the Project Manager skips over that line without adding the file to the Project.

For an example, consider the REPORT FORM command. Developers who offer destination options (to print, preview, and so on) often store those options to variables that are then referenced in the REPORT FORM expression by using macro substitution. Here s an example:

   output="preview"
   REPORT FORM customer &output

In spite of the fact that macro substitution is not used to reference the REPORT FORM file directly, having it any place in the expression causes the Project Manager to skip the line and not automatically bring the report file into the project during a project build. Therefore the file is missing from the .EXE file.

RESOLUTION

Use either of these resolutions:

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

Using the Customer database in the Tutorial subdirectory of the main FoxPro directory, build a report named Customer. Create a .PRG file named Test containing the following code:

   output="preview"
   REPORT FORM customer &output

Create a new project and add the Test.prg program to it. Build the project. Note that the Customer report form is not brought into the project. If this project is later built into an .EXE and all required support files are distributed (ESL, DBF, and so on), the customer can encounter this error:

   File Customer.frx Does Not Exist

Additional reference words: FoxWin FoxDos 2.50 2.50a 2.50b 2.60 2.60a KBCategory: kbprg kbprb kberrmsg KBSubcategory: FxprgMacrosub

Last Reviewed: July 31, 1995