Delphi XE2 : Off by 7-20 lines in debugger and compiler error line numbers also off by the same amount

前端 未结 3 1813
醉酒成梦
醉酒成梦 2021-02-19 10:21

I am having a problem with a large Delphi codebase where I work where as a side effect of porting from Delphi 2007 to XE2, we now encounter the following strange, related issues

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-19 11:18

    This is a common problem caused by mismatched line termination characters. (Code with a missing CR or LF on the end of the line.) It can also be caused by having a .dcu that doesn't match the source file that's open in the editor.

    For the first, the easiest fix is to open the source file in a regular text editor (such as Notepad). Make a small change (insert a blank line and then delete it), and save the file. Notepad will fix the line endings.

    If this isn't the issue, look for extra copies of the .dcu (or .pas) file that might be on your drive in the IDE's search path. Sometimes the compiler sees a different version than what's open in the editor.

提交回复
热议问题