Recent

Author Topic: Cannot open saved Projects  (Read 539 times)

erictan

  • New Member
  • *
  • Posts: 34
Cannot open saved Projects
« on: April 13, 2020, 11:34:37 am »
I am new to Lazarus and I have problem opening saved projects.
I am using Lazarus IDE v2.0.6 r62129 on Windows 10 PC.

I create a new test Lazarus Application Project, saved the project and quit Lazarus.
When I run Lazarus again and open the last save project, the Form and Source Editor did not open.
I tried several new projects and all have the same problem.

I installed Lazarus on another PC and I have the same problem.

I have installed Lazarus the day before and created many projects and close and open again without any problem.
It only happen today and I have not changed any of Lazarus settings.

Any help on the above is greatly appreciated.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6373
    • wiki
Re: Cannot open saved Projects
« Reply #1 on: April 13, 2020, 12:29:05 pm »
Generally hard to say what it is.

Did you use: File > Close all?

That would close the editors, and your project would remember.

Open: Project > Project Inspector
and double click your units to open them.
When the unit is open press F12 to get the form.

Don't use "close all".

erictan

  • New Member
  • *
  • Posts: 34
Re: Cannot open saved Projects
« Reply #2 on: April 13, 2020, 01:26:38 pm »
Yes, I have close all files and close Projects.
I have also uninstall and reinstall Lazarus IDE, even install Lazarus on another PC but all have the same problem.
After saving and existing the new Projects, when I try to open the Project again, the Object Inspector, Project Inspector and Message box all appear but not the Form and Source Editor.

I tried opening the Project from Open Project, Open Recent Project and from the File menu with the same problem.
Strange thing is it was working fine the day before when I go through a series of Lazarus tutorial.


JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3779
  • I like bugs.
Re: Cannot open saved Projects
« Reply #3 on: April 13, 2020, 01:35:11 pm »
It works as designed. You closed all files, including the main unit and form. The information about open files is remembered by the project.
Just open the unit from Project Inspector as Martin instructed and you are good to go.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6373
    • wiki
Re: Cannot open saved Projects
« Reply #4 on: April 13, 2020, 01:39:33 pm »
The "Close All" in the file menu, it does not do what you think it does.

For starters, you do not need to close projects, they get closed correctly when you exit the IDE or open another project.

"Close All" does not close the project.
It is in the "File" menu. It closes all open editors (all units/files).

But after "Close All" the project is still open. Just it has no open editors. When you close the IDE, then the IDE remembers, that the project has no open editors.
Next time you open the project, it will keep the editors closed. (You can access it via Project Inspector")

erictan

  • New Member
  • *
  • Posts: 34
Re: Cannot open saved Projects
« Reply #5 on: April 13, 2020, 02:17:48 pm »
My usual routine is, create a new project, test the project, save the project and then close the Project from the Project menu before I quit Lazarus. Later I will run lazarus again and open the project from the recently open project list.

This sequence was fine a day before when I was going through a series of Lazarus tutorial.
But today was weird when it just simply refused to open the past projects.

Maybe I will try again tomorrow after a good nigh sleep.
Thanks all for your help...much appreciated.

erictan

  • New Member
  • *
  • Posts: 34
Re: Cannot open saved Projects
« Reply #6 on: April 13, 2020, 03:47:20 pm »
I manage to duplicate the problem sequence and Martin and Juha were right.

If I "Close All" from the file menu, which I did at one point, the Form and Source Editor will close and not open again even if I open the Project again. I have to manually open the Unit and then F12 to open the Form.

So next time I will not use "Close All" but just Close Project and quit from Lazarus.
Would be nice if the Open Project can open all modules associated with the project no matter how you last close the project.

Thanks again Martin and JuhaManninen for your help.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6373
    • wiki
Re: Cannot open saved Projects
« Reply #7 on: April 13, 2020, 03:58:37 pm »
You do not even need to do "close project" (though it is ok to use it).
The IDE will automatically do so, if you close it (or open another project).

The IDE will also ask you, if you want to save changes. (if there are any).

The IDE will always save your session info (see below).
You can go to Tools > Options; and tell the IDE to ask before saving session info.

---
Each project has "session info"
(See project > Project Options > Session)

This stores:
- which files where open
- which line they were scrolled too
- where the editor window was placed on the screen
- Bookmarks
- .... much more

So when you open your project again, you can continue exactly where you were.

But "which files where open" includes "which files were closed" => So that is what you experienced.

You can disable session info entirely. But then you also do not store: scroll info, bookmarks and all else....
You need to disable for each project. (you can save as default for new projects / checkbox lower left corner of project options "set compiler opts as default")

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3779
  • I like bugs.
Re: Cannot open saved Projects
« Reply #8 on: April 13, 2020, 04:44:19 pm »
So next time I will not use "Close All" but just Close Project and quit from Lazarus.
No, you never need to "Close Project" explicitly. It is quite a useless menu entry, added because some users wanted it. After doing "Close Project" everything is disabled.
The active project is closed automatically when you open another one, create a new one, or close the IDE.

Quote
Would be nice if the Open Project can open all modules associated with the project no matter how you last close the project.
No!!!
A project can have hundreds of units. Do don't want them all opening automatically. The logic is perfect now. You decide what is open and what is not, and the system remembers it.

Most new users are confused with session info included in a project but soon it becomes a non-issue.

 

TinyPortal © 2005-2018