Wednesday, 30 September 2020

Good on ya, mate!

- or a shout-out for Alister Christie's new book: Code Faster in Delphi.

I just got a chance to review the first of a series of new books about Delphi from Alister Christie, and even if it is a short book - 160 pages - it is perfect and on the spot - looking forward to the next in the series.

You can get the book here: https://leanpub.com/codefasterindelphi - just take a look at the Table Of Content - a lot of great stuff.

Alister Christie has been doing his LearnDelphi.tv for many years - and his 150+ short videos are always to the point - on topic and precise - at least those I have seen :)

And speaking of video - watch his promotional video for the book - always fun and this one has WordStar bits :)

I will get my dead tree version as well - even if shipment cost probably will exceed the price of the book - but I want this nice books content and cover on my bookshelf.

Speaking of cover - as a little bonus I found this on 99designs: https://99designs.dk/book-cover-design/contests/code-faster-delphi-book-1018068 - so if anyone has a potential writer in them, this shows one process of getting a nice cover selected.

It has been more than 25 years since I last wrote a book - even if self publishing and cover contents are now a thing - it is not a trivial task - as I remember it, so well done - and thanks.

/Enjoy Alister's new book.

Monday, 31 August 2020

Hygge by the fireside

- or a fireside chat with Jim McKeeth


End April in the evening Jim and I had a fireside chat, which should had been in front of our masonry oven - but I ended up having it from my home office.




You can see the chat here - it is a bit long but I think we had fun, and to help you through it, I have done this post as a commentary track, and put a bit more details in various places.

And the word hygge now seems to have gotten into the Oxford English Dictionary - but still pronounced wrong :)

Friday, 31 July 2020

I am no Charles TDickensionary<>

- or a few TDictionary<> tricks.


One of my favourite classes in Delphi is TDictionary<> - might be because it resembles a database table which can have composite keys, and I have always been a ClientDataset/VirtualTable/FDMemTable fan-boy :)

I do not get to use the memTables that much i recent years, and the RTL generic collections also got better - while not on par with third party collections like Spring4D - which I also not get to use much.

I recently had a task where I had to transform some code that was collecting data from an external source, that provided data in a way that multiple iterations had to be done, before each row/item was complete - since data was coming in subsets per field/property. TDictionary<> to the rescue.


Monday, 27 July 2020

TTreeview your TOutline

- or migrating a TOutline to a TTreeview many years too late.


HighDPI themed Delphi 10.4 TOutline and TTreeview

The task to migrate from a working old TOutline to a TTreeview was long overdue in a small program I almost use daily - and its code had not really been touched since it was created.

TOutline was included in Delphi 1 back in the Win 3.1 days, and since Windows did not have any Treeview/Outline in its common controls it was purely VCL, not a wrapper.

It has for many years been advised to not use TOutline for any new projects, but instead use TTreeview or similar - but once in a while I do bump into this component - and this time I thought I would write a small and incomplete migration guide.

Thursday, 18 June 2020

D&D in Delphi source code?

- or does your device support Phone, Tablet or Elf?!




While looking through some of the RTL source code, in the quest for the "Tablet" mode (see my previous post from yesterday) - I stumbled upon the TDeviceInfo.TDeviceClass enum.

Wednesday, 17 June 2020

A cure for Win10 in Tablet mode

- or how to detect tablet mode in Windows 10 from Delphi.



Sorry about the cure-tablet pun, but Windows 10 is not able yet to enter Pill mode.

This small post is actually also about wrapping Win10 SDK apis, that might not have been fully implemented as Delphi classes/interfaces or are missing because of their little use - which incidentally is that ones I often miss.

I was getting a bit frustrated refactoring some old code, and thought that it would be fun to add a Windows 10 feature to the project instead - and since I was sitting on an old Surface - I could switch that into "Tablet" mode.

Sunday, 24 May 2020

May the "Default" be with you

- or bit of housekeeping in some very old code.

Since we are still in the month of May - I though I could get away with that title - but this small post is not about calendar months or Star Wars.

I have not been very active here for a while - but I wanted to write a bit on the lack of use of StrToXDef, TryStrToX and overloaded constructors that now have been in the RTL for many years.

Just preparing an old Delphi project for the upcoming 10.4 release (real soon now) - and I stumbled upon some horrid old code like this: