Zeina
Zeina

Reputation: 1603

How to fix a corrupted project?

I don't know what happened with my Delphi. It doesn't respond to my requests:

  1. when I Search for a certain word it leads me to wrong places.
  2. when I ctrl-click a certain function or variable it does nothing.
  3. when I click on an event from the Design it doesn't take me to the right function.
  4. Upon tracing, it stops without a rational reason.

This happens only with this project, because I opened a new project and it acted fine. Is there something corrupted with this project? (It is compiled and being built without errors.)

Upvotes: 3

Views: 2082

Answers (2)

Francesca
Francesca

Reputation: 21640

If this happens with a particular unit, it could be because you have a PAS file with corrupted line ends or some Unicode problem.

The usual, easy to spot symptom is that the blue dots on the compiled lines are out of sync with the actual code. (only the line where the debugger should be able to stop have the blue dots).

The simplest remedy is to copy the whole unit and paste it into a plain Notepad, then a quick scan for goofy characters will tell you if there is a possible unicode glitch. Once this is ruled out, just copy again the whole text and paste it back into the IDE; this should fix all the non-Windows line ends.

For the anecdote, it used to happen a lot where I was working when we had outsourcing with guys using Cyrillic based editors...

Upvotes: 5

Jeroen Wiert Pluimers
Jeroen Wiert Pluimers

Reputation: 24513

Try this:

  1. Start a new project (keep a backup of your old one!)
  2. copy over the content of your current .dpr file, but not the uses part.
  3. Then unit for unit start importing the units from your old project
    Perform all your actions at this stage (for each unit you try) to see for which unit it fails

Then compare your .dproj file with your old .dproj file, and mention the differences in a comment to see if we can resolve those differences.

Upvotes: 0

Related Questions