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


Sunday, February 16, 2020

Delphi Revisited: Database Application Design

I have been creating database applications for over 30 years. Unfortunately, I have never been able to create a single database application in Delphi. That's a very sad fact. One that I'm not very proud of. Because I've been unable to create a database application with Delphi, I considered myself mediocre. And then something happened... Delphi turned 25.

"And then something happened... Delphi turned 25"


I, like so many of you, spent time this past week looking at all the commotion on the internet over Delphi turning 25. Then I looked at the picture of me, and my two boys hanging in my home office. I've been using Delphi since it was Turbo Pascal 3. 


That picture was taken in 1994 for an article that ran in the December issue of Military Lifestyle magazine.


"You don't need to be a programming guru to be successful"


Wow, my Zilch software is 29 years old. It's older than Delphi. I'm not mediocre. I'm living proof you don't need to be a programming guru to be successful. You just need determination.

And then, I had an epiphany regarding my lack of database design skills with Delphi. I realized I have been concentrating on the wrong stuff. I got so bogged down with the "How to do Data Entry" aspects that I totally missed out on everything else I can do with Delphi.

I actually do have one commercial product, Credit Card Math, that uses an ElevateDB database. But you know what, even though this program uses a database, it does not have any "Data Entry" functions.

"Data entry does not a database application make!"


That's it! Data entry does not a database application make! I concentrated on the wrong thing, data entry. I need to focus on the presentation and the analysis, and the reporting of the data and not the data entry. 

All I need is data in the database. I can build the whole presentation layer and reports without having any data entry functions. (light bulb moment)

I have such a renewed spirit. I'm done fiddling around making fancy grids that do all sorts or nifty data entry tricks. I'm going to focus on the meat and potatoes of my application. When the time comes I'll deal with the data entry stuff.

It's time to get ready for Zilch turning 30 in 2021. 

Happy Birthday Delphi!

Semper Fi,
Gunny Mike