Sunday, May 7, 2023

Pseudo Code File Logic: Open > New > Save > Save As

Just finished working out the logic for handling file logic:

File Open
File New
File Save
File Save As

This assumes you are keeping track of the following:

  • Current Filename
  • Changes to file data
I've been wrestling with this one for a few days. And then it finally hit me. "Hey, Exit can be your friend."

Exit can be your friend

Within the last year, my thinking has been influenced by Jeff Patton and his book "User Story Mapping". At work I have been involved in many meetings/discussions where everyone is in agreement that we need to implement "Solution X". However, everyone has their own interpretation of what "Solution X" is.

Semper Fi
Gunny Mike

Friday, March 24, 2023

Delphi FMX Desktop Development: Part 1

Question: Is FMX Desktop Development Worth It?

This is part 1 in a series dedicated to Delphi FMX Desktop development. I am in the process of converting an old VCL application to FMX. When I first started playing around with FMX I was excited because one code base could serve up all different platforms; desktop, mobile, tablet. FMX also let's you create Windows, Mac OSX, Android, iPhone apps from that same single code base.

It wasn't until recently that I discovered one code base doesn't easily translate between desktop and mobile. So I am focused solely on creating one desktop code base for Windows and Mac OSX. This is a conscious choice on my part to stay in the desktop market. 

Over the last 32 years I have had several Mac OSX users asking me when I would have a version of my software that would work on their computers. Delphi FMX will let me make this happen. 

This leads to a series of questions:

  • What does the desktop market share look like?
  • How many new Mac customers will this bring me?
  • Is it worth the effort to create a desktop application for both Windows and Mac?
  • How does geographical location influence the decision?

I would like to thank the people at statcounter GlobalStats for providing the information in this post. Visit for more information.

"The Whole World's Gone Mobile!
Forget Desktop Development."

Let's start by looking at the Desktop vs Mobile vs Tablet market share. We are going to look at the past year and then look at the past ten years. This will show the huge growth in the mobile market.

Worldwide 1 Yr Mobile 60% Desktop 40%

Worldwide 10 Yr Mobile 16 → 60%↑ Desktop 82 → 40% ↓  

Looking at just this one graph you would think it's a waste of time to dive into the desktop market. On a world wide scale the mobile market has completely overtaken the desktop market. At first glance you might think, "Wow, it's not worth going after the desktop market. The whole world has gone mobile." 

"I Might be Ignoring 50% of the Users!"

What about the United States? Does geography play any part in my decision to create a desktop application? After all, the majority of my customers come from the United States.

USA 1 Yr Mobile 46% Desktop 52%

USA 10 Yr Mobile 15 → 46%↑ Desktop 82 → 52%↓

Because the majority of my customers are from the United States, and I'm only concerned with the Desktop market share, what do these numbers tell me?

Today, the Desktop market share in the United States is 52%. This tells me that 5 out of every 10 potential customers are desktop users. This also tells me that mobile use has skyrocketed over the past ten years, and my decision to only focus on desktop might be ignoring almost 50% of the users.

What about my decision to only focus on Windows and Mac OSX customers?

USA 10 Yr Windows 82 → 60% ↓ OSX 16 → 30%↑   

Here is what the Desktop Operating System landscape tells me looking at the past ten years. Windows is still the dominant operating system within the USA even though it has dropped 22%. On the other hand Mac OSX has almost doubled it's share of the market.

Overall, the prospects look good to invest some solid time and effort into creating a Desktop application that caters to both Windows and Mac users. As far as how many Mac OSX customers can I expect? 

These numbers tell me I can expect about 5 new Mac OSX customers for every 10 new Windows customers. And that sounds pretty good to me. 

Answer: It's worth it for me!

Use this link for all 32 videos from the Desktop First UX Summit 2021

Semper Fi
Gunny Mike

Sunday, February 19, 2023

DELPHICON 2023: Every APP Trick in Book with Ian Barker

DELPHICON 2023: Every APP Trick in the Book with Ian Barker 

Timestamp links have been added to each of the individual sections of this presentation.

Every App Trick in the Book


Elevation Button (VCL Only)


Settings Persistence

User Authentication OAUTH2
TMS SOftware Sphinx (€395 - €595)
eSeGeCe OAuth2 Client (€349 - €649)

NEW User BioMetrics

Check for Internet Conncetion

Splash Screens

Adding Some Coolness

Themes and Styles

Detecting Dark Mode (and Reacting when it changes)

Checking for Updates (2007)

In-App Scripting
TMS Script Studio Pro (€190 - €630)

Single Instance

Manipulating Images

To the Web
uniGUI ($395 - $890)
IntraWeb (€399 - €2,399)
TMS WEB Core (€395 - €1,295)

Let's Encrypt - Free SSL Certificates
Pault Toth Delphi ACME

Reverse Proxy via NGINX

Semper Fi
Gunny Mike

Saturday, February 18, 2023

DELPHICON 2023 - User Interface Design with Actions by Ray Konopka

Konopka does a fantastic job showing how to streamline the User Interface using Actions. This is a must see video from DELPHICON 2023.

He starts out showing the typical way of coding in Delphi by using onClick events on Buttons and Menus. He then shows how to build an ActionList from scratch, using Categories and Actions. He then ports all the onClick events to Action onExecute events. He also imparts the knowledge he's learned over the years as to why this is the best way to code a user interface. Absolutely brilliant.

Every time I watch Konopka give a presentation I learn something. It's amazing to watch a master demonstrate his craft. 

Video presentation link:

Source code link:

Semper Fi
Gunny Mike

Sunday, February 12, 2023

Use ChatGPT to Convert Other Language Source Code to Delphi

If you've read some of my previous posts you know how much I've struggled to make the paradigm shift from being a top-down, procedural programmer to an OOP programmer. I've purchased several books on OOP. And one book series I thought would hold some promise are "The Object-Oriented Thought Process" books written by Matt Weisfeld. I have four different editions on my book shelf.

I struggle with OOP for several reasons. One very frustrating reason is the lack of Delphi/Pascal examples used by authors. Most of the code examples are written in Java, or C, or C# or some language other than Delphi/Pascal.

The last bullet point on page 3 of Weisfled's fourth edition, listed under the heading of "What's New in the Fourth Edition", states:

  • Expanded code examples, for certain chapters, in Java, C# .NET, VB .NET, and Objective-C available online on the publisher's website

No Object Pascal or Delphi examples!

No Object Pascal or Delphi examples. I reached out to Weisfeld asking if he might include Object Pascal examples and received a negative response.

I love Pascal. It's elegant. It's easy to read and understand. I've been using Pascal/Delphi since 1985. (2023-1985=38 years). Besides SQL, it's my main programming language. Ok, I confess, I did Active Server Pages (APS) and VB Script for about 10 years.

I've tried loading Java onto my machine so I could follow along and learn the OOP concepts but I just can't wrap my head around the Java syntax.

Today, I discovered the answer that works for me. ChatGPT!

I asked ChatGPT to convert the following Java code from page 24 of "The Object-Oriented Thought Process" to Delphi and the results were very hopeful.

public class IntSquare {

  // private attribute
  private int squareValue;
  //public interface
  public in getSquare (int value) {
    squareValue = calculateSquare(value);
    return SquareValue
  //private implementation
  private int calculation (int value) {
    return Math.pow(value,2);

Here are the results returned from ChatGPT:

TIntSquare = class
FSquareValue: Integer;
function CalculateSquare(value: Integer): Integer;
function GetSquare(value: Integer): Integer;


function TIntSquare.CalculateSquare(value: Integer): Integer;
Result := value * value;

function TIntSquare.GetSquare(value: Integer): Integer;
FSquareValue := CalculateSquare(value);
Result := FSquareValue;


I know the results are not the indented and formatted code you would get from inside the IDE. This was my first attempt at using ChatGPT. I took several screen shots of my interaction with ChatGPT so I can show you what happened.

Here is my entire ChatGPT session:

Here is the final output from ChatGPT.

  TIntSquare = class
    FSquareValue: Integer;
    function GetSquareValue: Integer;
    procedure SetSquareValue(const Value: Integer);
    function CalculateSquare(value: Integer): Integer;
    property SquareValue: Integer read GetSquareValue write SetSquareValue;
    function GetSquare(value: Integer): Integer;


function TIntSquare.CalculateSquare(value: Integer): Integer;
  Result := Round(Power(value, 2));

function TIntSquare.GetSquare(value: Integer): Integer;
  SquareValue := CalculateSquare(value);
  Result := SquareValue;

function TIntSquare.GetSquareValue: Integer;
  Result := FSquareValue;

procedure TIntSquare.SetSquareValue(const Value: Integer);
  FSquareValue := Value;


This looks very promising! Give ChatGPT a try converting code.

Semper Fi
Gunny Mike

Monday, December 5, 2022

The Kinetic Technique by H. A. Overstreet (1925)

Influencing Human Behavior by H. A. Overstreet was published in 1925. I purchased an old hardcover copy of his book over a year ago because, some other book I was reading referred to it as a master work. Overstreet's book has been sitting on my oak book shelf, which was built by a very nice Mennonite man in Maryland, ever since it arrived.

I spent the weekend of November 26th and 27th entering all my "print books" into a software program called Calibre ( which by the way, is mainly for managing E-books.

After saving the information from an ISBN import, I began reading. I stopped on page 12 after reading what Overstreet wrote about capturing one's attention using "The Kinetic Technique".

I stopped reading because this piece of wisdom so grabbed ahold of me, I wanted to let it seep into my mind.

Two days later on Tuesday morning at 1:45 AM I woke to a racing mind. "What book talked about a dot on the wall?" I kept searching, and searching my thoughts. Nothing.

"Ah, the influencing human behavior book."

Why was this so important that it woke me up? My website (read that as I) totally violated the principle of movement. Every page on my website has the same big-ass banner. I was making all my visitors (read that as potential customers) stare at a dot on the wall. How boring is that.

I jumped out of bed right then and there and started working on removing the dot from my website. It took me a few days, but I managed to get rid of that dot. But more importantly, I learned a valuable lesson from some ink that was printed nearly 100 years ago.

Thank you Mr. H. A. Overstreet. I can't wait to see what else of yours seeps into my mind.

Influencing Human Behavior - H. A. Overstreet (page 12)

Gunny Mike

Monday, July 11, 2022

Delphi Tip of the Day - Environment Variables used only by the Delphi IDE

 I wanted a quick, down-and-dirty, reference to only those variables used by the Delphi IDE. Inside the IDE you can navigate to Tools > Options > IDE > Environment Variables. This will list all the Environment Variables currently in use. Those belonging to Delph and those outside of Delphi. However, that is not what I was looking for. I just wanted the Environment Variables specific to the Delphi IDE.

Generating this list was a three step process which involved some code I found here.

Step 1. I entered and ran the code from the above link. I then copied and pasted the contents of the memo to a separate text file called EnVars-Delphi-IDE.txt.

Step 2. I closed Delphi and ran the program again from the saved location. I then copied and pasted the contents of the memo to a file called EnVars-Without-Delphi-IDE.txt.

Step 3. I then navigated to the Delphi BDSBIN location and ran the Beyond Compare utility BCompareLite.exe. I did a text compare of  EnVars-Delphi-IDE.txt and EnVars-Without-Delphi-IDE.txt looking only for the differences.

I simply copied all the text from the left-had side and saved it as EnVars-Delphi-IDE-Only.txt. And know I have my quick down and dirty list of Delphi IDE Environment Variables.

Here the list generated from my computer. YMMV

BDS=C:\program files (x86)\embarcadero\studio\22.0
BDSBIN=C:\program files (x86)\embarcadero\studio\22.0\bin
BDSINCLUDE=C:\program files (x86)\embarcadero\studio\22.0\include
BDSLIB=C:\program files (x86)\embarcadero\studio\22.0\lib
DELPHI=C:\program files (x86)\embarcadero\studio\22.0
InterBase=C:\program files (x86)\embarcadero\studio\22.0\InterBase2020

Beyond Compare is a fantastic tool written with Delphi. The lite version is included with your purchase of Delphi. For more information about Beyond Compare visit their website:

Gunny Mike