Sunday, February 23, 2020

Delphi Tip of the Day - Autosave Project Desktop

I am not a full-time Delphi guy. So, when I'm learning Delphi by reading OPC (other people's code) I want to make the best of my time. I was studying some code from Cary Jensen that goes with Chapter 6 of his Delphi in Depth: FireDAC book.

When I was done understanding a section of his code, I simply folded it. I figured I beat that code up enough in my mind. I understood it. And I don't need to look at it again, at least not right now. I also didn't want to be distracted by having those code blocks expanded. 

I started a brand new project in Delphi to write some of my own code that was similar but different, just to reinforce what I learned. When I was finished, I reopened Jensen's code and the pieces of code I had folded were no longer folded. 

It turns out this is an easy fix. Simply enable "Save project desktop when closing".
Tools > Options > IDE > Saving and Desktop


Not only did this keep sections of the code I had folded, folded, it remembered whether my last view was Code view or Design view. It also kept track of where in the code view I left off. I was looking at line 522 in the source code when I close the project, Delphi put me right back at line 522 the next time I reopened the project. How cool is that.

Enjoy!
Semper Fi
Gunny Mike


No comments:

Post a Comment