Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modified programs don't execute 1

Status
Not open for further replies.

Wes1961

Technical User
Aug 21, 2001
72
0
0
US
I'm using FoxPro 2.5 for DOS running under Windows 95. Sometimes (not always) when I modify a file (myfile.prg) using the modify file command and the try to execute the file using "Do myfile". The old version executes. I have to exit FoxPro then restart and the modified version then executes. Any ideas/help?
 
I remember that problem from a time long, long, ago.
Fox is running a cached file, you have to flush the system cache. but I can not remember how to do it. Been a long time since I've had to play with it.
I do remember the problem was address in the foxpro help under the setup section.
try these topics in the help section

Configuring Microsoft MS-DOS for a Clean Boot
Configuring FoxPro David W. Grewe
Dave@internationalbid.com
 
Wes,
You might check the "Compile on save" option. In Fox2.6 for DOS or Windows, if it is not on, you will modifiy the .PRG, but it does not re-compile. If you "Run" the program from the command window with something like:

DO MYFILE

You will get your old file, because Fox is actually executing the last MYFILE.FXP, not MYFILE.PRG, which is the compiled version of your .PRG file. Fox is interpatvie, but still compiles the code. You can solve this in several ways. First, select Program, the Compile, when you are done, before you try to run it. If I remember correctly (I don't remember specifically where, but I think it is under preferences when you are editing a .PRG, which you get at from the Edit Menu), there is a check box that says "Compile on save", or something to that effect. Make sure it is checked.

The only other anomoly I've encountered with this type of problem was a corrupt FOXUSER file. You can always just delete the FOXUSER.* files, and allow fox to create "Clean" copies of them the next time you start fox. The way to find out exactly which FOXUSER file you are using is, from the command window, issue the following command:

? SET('RESOURCE',1)

which will display the exact path and file name of your FOXUSER location.

Please let me know if this helps.
-Scott
 
You may also want to try:
CLEAR PROGRAM

This will explicitly clear the cached program code (as described in the help file under CLEAR.)

Rick
 
Or just COMP Myfile at the command line would be easier than shutting down and restarting Fox.
 
You might also check the setting of SET DEVELOPMENT to make sure it is ON. This forces a comparison of the creation date and time of the source program and its corresponding compiled object file. If the source file is newer than the its compiled object program, Foxpro recompiles the program before it is executed. The only thing you need to ensure is that Fox knows where these files are at. If your source is farther down your path it might mistakenly start the older compiled file.

--CDavis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top