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:
- Close the screen if it is still running, and type the following command
in the Command window:
MODIFY PROJECT <project_name>
- 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.
- Select APPCTRL and choose the Edit button.
- 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)
- 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)
- 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
- In the Command window, issue the following commands:
USE tutorial\salesman
MODIFY STRUCTURE
The Table Structure dialog box will appear.
- Locate the field called ONO. Change the name of the field to MNAME.
- In the Command window, type:
DO foxapp.app
- 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.
- In the FoxPro Application Generator dialog box, choose the Generate
button. This builds the menu and screens.
- Save the application with the name SALESMAN.APP.
- 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)
|