Jump to content
ertank

Cannot open project main form

Recommended Posts

Hello,

 

There is a project that I have problem loading with Delphi 10.4.2. Main form is not loaded and Structure has below error line in it

E2029 Declaration expected but end of file found at line 1 (1:1)

I checked the DFM and PAS files using text editor and also hex editor. Both seems fine to me. Only thing is PAS file is UTF8 with BOM and that is not a problem at all. BOM bytes are also correct (ef bb bf).

 

Unit file begins as following second line with a remark

image.png.bbacd224128bb72bf87ac23d6effc05c.png

DFM file begins as following

image.png.ccef14885aee195b4488231d413e069d.png

 

Project is from a private subversion repository. I checkout that repository as fresh in another directory and I still could not open it. But, another computer with Delphi 10.3.3 can load the project and its main form just fine.

 

DFM size is 3,544,092 bytes

PAS size is 414,839 bytes

 

I didn't hear any limit about dfm/unit size. Providing these information just in case.

 

My internet searches lead to actually corrupt files having similar errors and line number is not one. Wanted to ask in here with the hope that I am not the only person and there is a way to solve the problem.

 

Thanks & Regards,

Ertan

Share this post


Link to post

Have you tried to open the .pas file when the .dfm file is not there? And vice versa?

Share this post


Link to post

Didn't think of that. Opening only .pas file alone gives below error 

ANA_SAYFA.pas(1): Line endings were inconsistent and have been converted to CRLF.

However, still no code displayed and it is an empty page. Something to check though.

Thank you.

Share this post


Link to post

I would open both files with notepad++ and save them / convert them to "windows CR LF" and "ANSI" and try it again with delphi.

Share this post


Link to post
3 hours ago, microtronx said:

and "ANSI"

it's a bad idea, only English text should be saved as ANSI, otherwise you should always save as UTF-8.

Share this post


Link to post

Open the file with Notepad++ and enable the option "show invisible chars". May there are someone chars where you not see on a normal editor

Share this post


Link to post

Once line endings are fixed, project opened just fine.

Seems Delphi 10.3.3 breaks them. Maybe when file is UTF8 encoded...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×