Friday, August 12, 2016

How to use the SET LOG MESSAGE Feature Within ElevateDB

The more I use ElevateDB the more impressed I get with this product. Last week I visited the ElevateDB support forum, most likely related to a syntax issue I was trying to resolve. As I read through some of the posts written by other users, I came across a very curious and interesting tidbit of information. A user mentioned the following:
"If you add a log message before the OPEN Crsr, you will see that the function is executed for each row."
This certainly got my investigative juices flowing. I had to find out what he meant. He was referring to the SET LOG MESSAGE statement. There were no pictures to show how to implement this log message feature so I began digging around and figured out how this works.

ElevateDB comes with it's own GUI called ElevateDB Manager. It's similar to the SQL Server Management Studio (SSMS) Microsoft distributes.

Here is a screenshot of a New.SQL script inside ElevateDB Manager

The SQL script is a simple loop from 1 to 100 that displays a log message each time X is a multiple of 7.

If you execute this script it tells you that "The script was executed successfully in 0 seconds". But where are the log messages?

You have to turn them on.

With the Explorer > Log Messages visible you see all the SET LOG MESSAGE statements. The log messages continue to accumulate each time you execute a script. There are two undocumented ventures available within the Log Messages pane: Save and Clear.

Simply right click anywhere within the log message pane you have an option to either Save or Clear the log messages.

I love the SET LOG MESSAGE feature and use it all the time. I find it extremely helpful and I hope you do as well.

Semper Fi
Gunny Mike

Sunday, April 24, 2016

A Better Way to Present and Organize Error Messages in Your Delphi Applications

I'm in the process of totally redesigning an application I wrote 25 years ago. Today, I decided to look for a better way to present error messages to my customers. In the past I simply littered my code with bunch of technical speak ShowMessage('bla bla bla technical speak bla bla bla'); code fragments.

With the help of Google, it didn't take long to find out that the best approach is to use "Apologetic" language in error messages. This has a positive effect on your customers.

I've never liked the idea that the standard ShowMessage gets positioned centered on the screen. I'd rather have a messaged display centered on the window where the error occurs. I also don't want my error messages scattered all over the place. So, I set out to do two things;
  1. Display error messages that are centered on the form where the error occurs
  2. Centralize all the error messages in one place
I created a separate unit for the express purpose of managing and displaying error messages:

This makes it very easy to keep track of all the error messages. It also lets me easily create similar but slightly different error messages for any given situation. I can also group related error messages by using a simple number scheme.

I'm a big fan of code completion Ctrl+Space. When I need to include an error message I simply type zmsg Ctrl+Space and up pops the code completion window with all the available error messages that I can choose from.

zmsg Code Completion

Semper Fi
Gunny Mike

P.S. As far as using "we" inside the error messages. I asked my wife if she was okay with an application giving this type of feedback and she said it was fine with her.

Sunday, February 21, 2016

Real World Justification for Purchasing Component Source Code

I'm working on a database project using Delphi 10S Update 1. The database I'm using is ElevateDB, which is written with Delphi. I licensed the ElevateDB VCL Standard version without source code back in 2011 and maintain my annual subscription. I'm very happy with this product.

I ran into an issue where inside the IDE both the 32-bit and 64-bit platforms display data in a grid when all the components are connected and active. However, when I run the application the 32-bit version works great but the 64-bit version gives me an Access Violation.

I read that the initial Delphi 10S had a problem with the 64-bit compiler. I figured that since I upgraded to Delphi 10S Update 1, I didn't have an issue with the 64-bit version of the compiler.

What I failed to realize and only realized after three or four days of frantic postings on the ElevateDB support form, was I was using compiled DCU's. These DCU's, both 32-bit and 64-bit versions, were compiled using the initial Delphi 10S release. Therefore, the 64-bit DCU's were built with the initial flawed Delphi 10S 64-bit compiler.

Shame on me for not understanding and realizing this in the first place. If I had, I would not have acted the way I did.

This brings me to the topic of this blog post. If I had purchased the source code version of these components I could have simply done a build all and the problem would have been solved. I don't remember my reason for not purchasing the source code version. Perhaps it was the added expense. Perhaps it was my thinking "I'm never going to monkey with the code and didn't need it".

The thought never entered my mind that I could wind up with flawed DCU's because they were built with a flawed Delphi compiler.

Lesson Learned!

Semper Fi,

Gunny Mike

Wednesday, February 3, 2016

Poll: What type of Delphi shop are you?

Back in November I conducted a poll to find out what kind of Delphi shop people belonged to. From these results 70% of the Delphi shops have 5 or less employees.

Here are the results:

Poll Results

Here is the link if you'd like to cast your vote.

Enjoy - Semper Fi
Gunny Mike

Saturday, January 30, 2016

A few minor "out of the box" tweaks for Delphi 10 Seattle

I recently upgraded to Delphi 10 Seattle Update 1. The first thing I noticed when I fired up the IDE was the font size of the Object Inspector and Tool Palette looked oddly larger. Then I remembered I had tweaked these settings a while ago when I first installed Delphi 10 Seattle. Of course I couldn't remember how I did this but I did remember there was a discussion about it somewhere.

The "out of the box" font setting for Delphi 10 Seattle is Segoe UI with a font size of 10. I prefer a font size of 9. Embarcadero has a nice wiki on how to change the initial settings.

I made one minor adjustment to EMBT's recommended settings:
Windows Registry Editor Version 5.00

"FontName"="Segoe UI"
The only other tweak I made was to the editor font. I prefer "Consolas" mainly because it formats zeros with a slash which makes them stand out from the letter "O". The editor font is located here:

Tools > Options > Editor Options > Display

Share your "out of the box" tweaks for Delphi 10 Seattle in the comments.

Enjoy - Semper Fi
Gunny Mike

Wednesday, October 14, 2015

Create Professional Installs for Mac OS X

I'm just getting started with learning cross-application development. One of the many issues that's crossed my mind has been how do I get the Mac OS X version of my software installed on a customers machine.

Well that question was answered yesterday during the "Prototyping an Object Pascal Code Editor with FireMonkey in Delphi for Windows and OSX" object pascal CodeRageX session.

Eli M. from Peacekeeper Enterprises, LLC presented a slide for a product that lets you create installs for Mac OS X. The product is called Packages and can be found at the below url:

I have not tried Packages yet. However, it appears similar to the Inno Setup tool for Windows.

Enjoy - Semper Fi,
Gunny Mike

Monday, September 28, 2015

FireMonkey Under the Hood: How FireMonkey Does What It Does

Here are two great videos from ITDevCon 2012 by Ray Konopka that talk about how FireMonkey does what it does. Ray gives an overview of the high-level differences between VCL and FMX. In part 2 he shows how to create custom FMX controls.

I love the way Ray gets frustrated. He's just like us.

Creating Custom FireMonkey Controls Part 1

Creating Custom FireMonkey Controls Part 2 

Update: 10/03/2015
I spoke with Ray and he gave me the link so we can download the source code he used in the demo. Thanks Ray!

Enjoy - Semper Fi
Gunny Mike