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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Corruption of PJX file

Status
Not open for further replies.

mmerlinn

Programmer
May 20, 2005
749
US
This has been an ongoing problem for me for years. And I just today got hit again, fortunately for the first time in months.

During developement using FP2.6, if I fail to immediately close the .PJX window after building the application and before testing the application the .PJX file can be corrupted. This happens only if there is some sort of an error in the application, never when the app runs correctly. And never when the PJX window is already closed.

Obviously, the PJX file is being corrupted because the modified PJX file is not being saved until the PJX window is closed. And when there is an error in the app, the PJX file either doesn't get saved with the modifications, or it is getting saved with corrupted modifications. Either way, when that happens, it takes me a long time to get the PJX file working again.

My questions are:

1) Is there any way, short of trying to remember to close the PJX window after every build, to automatically circumvent this problem? Closing the PJX window dozens of times per day and reopening it every time to modify the app is a royal pain, and is easily forgotten at the worst possible times.

2) If not, is there any simple way of recovering from corruptions that will sooner or later occur?

Currently, I periodically save the whole project, including the PJX file to another disk. Then when I need to recover, reload the saved PJX and PJT files, and use them as the base to continue building the app. Unfortunately, added/modified/deleted files in the corrupted PJX file are not in the saved file, so it sometimes takes me hours to bring the saved PJX file up to speed and working properly before I can pick up where I left off in the developement of the app.




mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Mike:

Not sure how that will help as the project files (PJX & PJT) are getting corrupted, not any of the runtime or compiled files.

Regardless, I will put the EXTERNALs in it, then purposely crash the program to see whether it works.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
You could do your development and testing in different instances of FoxPro.

That said, the project should be saved when you build it, so I think your analysis of what's going wrong isn't accurate.

Tamar
 
Tamor:

Don't know what you mean by testing in different instances of FP. Sounds like you mean to test on different computers. If so, that would mean that I would build the app, move the app to a different environment, test the app, correct the problems that pop up, build again, move again, test again, correct again, ad infinitum. Moving app to a different environment, possibly dozens of time per day just seems to add to developement time with little if any benefit.

As noted in the first post, I try to remember to save the app at the end of every build. To the best of my knowledge the only way to save the project is to close the project window, cuz as long as the window remains open, the project seems to be subject to corruption.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
By testing in different instances of FoxPro I guess Tamar means to open two windows in the same computer, so that you don't have to move anything.
 


TheRambler

Now I am confused. I usually run with several windows open, but I have no idea how to run two copies of FP2.6 with each one in a different window on the same machine.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
I have no idea how to run two copies of FP2.6 with each one in a different window on the same machine.

I hope I'm not jumping in with a simplistic solution but if I double-click on the shortcut to FPW26 then FPW26 opens in a window. If I double-click on the shortcut again then FPW26 opens again in another window. I often sit with the two windows side-by-side on screen so that I can do simple tests on things like record-locking code.

Geoff Franklin
 

myearwood

I am still somewhat confused on exactly what to put in my main.prg. Also, not sure how to use that to recover from file corruption.

Could you provide, either here or via FAQ, details on what to do, with examples? Also, a detailed explanation of how this works would also help.

Thanks.




mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
I keep a copy of xxx.pjt and xxx.pjx in a backup directory.
Each time I start Foxpro (with a startup batch file) these two files are copied into the working directory.
The only time you need to update the backup files is if you add something to the project.
 
Mike

Still having problems implementing your suggestion.

Seems that the problem lies in my organization of Library functions.

When I put
[tt]
PROCEDURE PMInclude
EXTERNAL PROCEDURE Main.PRG
RETURN
[/tt]

in my main.PRG and tried to build a new instance of my project under a different name, I get multiple 'Unable to find Unknown xxxx' errors where xxxx is the name of some function, procedure, or whatever.

When I include those xxxx files as EXTERNAL PROCEDURE xxxx.PRG, things do not change. FP cannot find the files - I have to manually remember where they are at. I am assuming that I will have to include the full path for FP to find them.

The problem lies, I think, in the Library function directory. There I have dozens of UDFs, PRGs, etc grouped in different directories by what they do. All generic functions go there while all program specific ones are in the same directory as main.PRG.

My question is, "Am I going to have to include the full path of ALL Library functions in the EXTERNALs? Or is there a way of determining which one in each directory should be included and which ones do not need to be included?"

As it stands, including EXTERNALs does not change what I have to do to recover from corruption. I still have to find each and every file one at a time.




mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top