PRB: "File <Name>.PRG Not Found" w/ FoxApp-Created Application

Last reviewed: April 30, 1996
Article ID: Q119283
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.5x, 2.6

SYMPTOMS

The error message "File <name>.prg not found" appears with random program names not found; for example, "File a.prg not found."

CAUSE

If the application was created by FoxApp, this error occurs because the APPCTRL screen uses a macro substitution variable called mname, and the database that the application is built upon contains a field named MNAME.

RESOLUTION

There are two ways to solve this problem:

Solution 1

Edit the screen set and change the variable name from mname to m.mname.

To do this:

  1. Close the screen if it is still running, and type the following command in the Command window:

          MODIFY PROJECT <project_name>
    

  2. If a screen set is not listed, choose the Add button and add the APPCTRL.SCX file. If a screen set is listed, double-click the screen set.

    The Edit Screen Set dialog box will appear.

  3. Select APPCTRL and choose the Edit button.

  4. In the APPCTRL.SCX Screen Design window, double-click the Search button. This will open the Push Button dialog box. Choose the Valid button. A DO CASE statement will be shown. Scroll down to the following section:

          CASE act3 = 5
    
             IF !regen
               mname = 'appsrch.prg'
             ELSE
               mname = 'appsrch.spr'
             ENDIF
          DO (mname)
    
    

  5. Change the DO CASE statement to look like the following by adding "m." (without the quotation marks) to the three mname references:

          CASE act3 = 5
    
             IF !regen
               m.mname = 'appsrch.prg'
             ELSE
               m.mname = 'appsrch.spr'
             ENDIF
          DO (m.mname)
    
    

  6. Save the changes and rebuild the project.

Solution 2

Rename the MNAME field in the database to some other name; for example, use MIDDLE for the field name instead of MNAME.

MORE INFORMATION

Steps to Reproduce Problem

  1. In the Command window, issue the following commands:

          USE tutorial\salesman
          MODIFY STRUCTURE
    

    The Table Structure dialog box will appear.

  2. Locate the field called ONO. Change the name of the field to MNAME.

  3. In the Command window, type:

          DO foxapp.app
    

  4. In the FoxPro Application Generator dialog box, choose the From File button, locate the SALESMAN database that contains the MNAME field, and then choose the Open button.

  5. In the FoxPro Application Generator dialog box, choose the Generate button. This builds the menu and screens.

  6. Save the application with the name SALESMAN.APP.

  7. Run the application by pressing any key. Once the screen is running, choose the Search button.

The following error messages will appear:

   File 1.prg does not exist

   Source: do (mname)


Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b 2.60 named
KBCategory: kbprg kbprb
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: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.