Jump to content
MJBComp

Delphi 10.4.2 won't open a specific .PAS file

Recommended Posts

I have a Delphi 10.4.2 project that has issues when clicking the file [lighttheme.pas] in the Projects window on the right.  It won't open the file.  I loads information into the Object Inspector but the file doesn't create a tab at the top.

 

This file does not an associated .DFM.  Its a unit file that holds procedures.  The only way i can get it to open where i can edit it is to close my project then choose File | Open...and open the file that way.  

 

I have also tried to remove it and re-add it to my project with no change.  Something is stuck somewhere.  Any ideas?

 

DelphiWeird.jpg

Share this post


Link to post

How big is the file? It might have some odd characters in it that the IDE cannot handle? Or maybe some peculiar structure?

 

For the characters problem: try loading it in Notepad, make a minor change, then save it, then load it in Delphi again.

Share this post


Link to post

The file is only 29KB.  I can open in Notepad++ fine.  I can launch Delphi and do File | Open and it opens fine. I don't see anything unusual.

 

The problem is when i open my Project file and then click on it to open/edit the file it won't open.

 

And it does me no good to open it in Delphi by itself because as soon as i open my Project File it closes that individual file.  Its a Catch / 22. LOL

  • Like 1

Share this post


Link to post

Probably incorrect/mixed line endings?

Is it the only file that causes this bug?

Will the bug appear on a clean project with only that unit added?

Can you attach this file for others to check?

Share this post


Link to post

Maybe its not the file itself but the project that's broken?

  • Like 1

Share this post


Link to post

the file was originally called light_theme.pas.   I renamed it to lighttheme.pas and its working again.  I have more than 50 files in this project and this was the only file that had an 'underscore' character in the name.  Delphi still shouldn't have problems opening a file with an underscore.  But its working fine now.  

Share this post


Link to post

Recent versions of Delphi seem to dislike units with underscores, I'm currently converting some Delphi 2007 projects to D11 and renamed two units so far to remove underscores.

 

Angus

 

Share this post


Link to post
22 minutes ago, Angus Robertson said:

Recent versions of Delphi seem to dislike units with underscores, I'm currently converting some Delphi 2007 projects to D11 and renamed two units so far to remove underscores.

Hm, all GExperts units have an underscore in the name: GX_Whatever and all units in my dzlib library do too: u_dzWhatever as well as most units and forms in the projects at work: w_Whatever and u_Whatever. We are not using D11 yet at work (and for GExperts I try to avoid it too because it always breaks the dfm files), but that doesn't bode well.

 

I wonder whether using underscores in unit names is that uncommon that nobody has come across a problem with that during the beta.

Share this post


Link to post

I also have units with underscores, but this was a form so perhaps different rules apply, did not think much of it at the time since I was skipping past the hundreds of modal dialog box errors Delphi gives when opening a project with components that are not currently installed, why no 'ignore all' button and why no logging of all the errors?   It's so frustrating when you migrate projects or update Delphi. 

 

Angus

 

Share this post


Link to post

Ok i did more testing and i can now reproduce the error with ANY delphi PAS file.  Can someone test this to see if it its reproducible on your Delphi as well.

 

It all stems from right clicking any open .PAS file and selecting 'New Edit Window'.

 

Once you have the source file open in a second edit window, Compile your App and let run, then close your app and return to the IDE.

Now leave the second edit window open and close your project, close delphi, and restart delphi.

Once you are back in Delphi, open  your project, then from the open tabs, close your PAS file that is open in the second edit window.

Now if you try and double click that PAS file in the Project window it won't open the file any more.  (BUG)

 

How you can gain the functionality back is to open your Project.dsk file and in the [Modules] section, find the line that has your stuck pas file and delete that line.

 

Reopen delphi and you can now open  your PAS file again.

 

So there is a problem with the IDE and having a new edit window open. Its like the PAS file thats associated with the new edit window gets stuck. So when you try and open it Delphi thinks its already open but you never get the interface.

  • Thanks 1

Share this post


Link to post

Better put a link here. Let us not look for it. I won't vote for you this way:classic_smile:

Share this post


Link to post

No issues were found to match your search  Try modifying your search criteria:classic_sad:

I have a saying: my laziness, don't leave me!

Share this post


Link to post
3 hours ago, Roger Cigol said:

It would be interesting to know if the same problem exists on 11.1  - does anyone have time to check this ?

 

There are problems with ctrl+click to open files in D11.1 I didn't checked the RSP. (We can only hope that the beta testers will fill enough bug report on this issue and it will be fixed in the next versions. Dear beta testers the future of the Delphi community is in your hands).

Share this post


Link to post

Beta testers are not magicians (at least none of the ones I've ever met are). If you don't file an RSP it is much less likely that the bug you vaguely describe here ("problems with ctrl+click to open files") will be fixed.....Please do file an RSP.

Share this post


Link to post

I didn't started this thread. I just don't care anymore when something doesn't work in the IDE. I already failed to make a test case for more interesting bugs.

 

I just like to use my time in a more productive way.

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

×