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

Last reviewed: July 31, 1995
Article ID: Q132696
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a

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:

  • Do not use macro substitution in a command expression that makes reference to a file that exists at some place within one of the project files.

    -or-

  • Add the file to the project manually.

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 31, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.