Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DO FILE can run FILE.mpr instead of FILE.prg
Message
From
27/07/1999 12:25:55
Karl Zercoe
Titanium Software, Inc.
Houston, Texas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
DO FILE can run FILE.mpr instead of FILE.prg
Miscellaneous
Thread ID:
00246686
Message ID:
00246686
Views:
42
If I call programs with the same name and different file extensions then FoxPro seems to get confused about which program to run.

I have three files.
Main.prg
Program1.prg - Contains 1 line of code eg WAIT WIND "PRG"
Program1.mpr - Contains 1 line of code eg WAIT WIND "MPR"

Main.prg consists of the following three lines and is run from the command window with DO MAIN:

do Program1 && This runs Program1.PRG as expected
do Program1.mpr && This runs Program1.MPR as expected
do Program1 && This runs Program1.MPR again instead of Program1.PRG

If I compile it and run the APP or EXE then I get:

do Program1 && This runs Program1.PRG as expected
do Program1.mpr && This runs Program1.MPR as expected
do Program1 && This runs Program1.PRG as expected

I recently updated to Service Pack 3 and found this behavior. This behavior only exists after Service Pack 3 was installed and only if you run it as individual files. If you compile it into an application or executable it works as expected. I had another colleague test this who had not updated to Service Pack 3 and she said it behaved as she expected before installing the update and then differently after. This leaves me to believe that it is not specific to my computer/configuration.

I know of some work-arounds like making sure that all file names are unique. I know you can specify a PRG extension for DO FileName.PRG but that will not help me if FileName is a function since X = FileName.prg() is not valid syntax.

Confirmation of this behavior would be appreciated along with any suggestions. I can change my source code in my legacy applications if I know that there is no other option. I am currently having to compile my application into an APP or EXE everytime just to test it.
Next
Reply
Map
View

Click here to load this message in the networking platform