Search code examples
delphidelphi-2007

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.)


Solution

  • 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...