Converted dfm to Text Format

Today Stefan Glienke mentioned at Google+ that there are some libraries which still use the binary format for dfm files. This is an issue since it is nearly impossible to recognize the changes in your vcs.

I do remember old Delphi version which only supported the binary format. In the Delphi bin folder you can find the convert.exe tool that converts a dfm file to the text format and vice versa. You can simply drop a dfm file on it.

Stefan mentioned that one if the libs with binaries is Abbrevia so that I converted them to the text format.

Posted in C++-Builder, Delphi, RAD Studio 10.2 Tokyo, Third Party Components, Tips and Tricks, TurboPack, Uncategorized | Leave a comment

Free Capacities

Hi all,

I currently have free capacities. I’m looking for remote contract work. I’m a specialist in all Delphi versions, particularly components, SQL databases, ORM and multi-threading.


Thanks,

Roman

Posted in C++-Builder, Delphi, FireMonkey, RAD Studio 10 Seattle, RAD Studio 10.1 Berlin, RAD Studio 10.2 Tokyo, RAD Studio XE5, RAD Studio XE6, RAD Studio XE7, RAD Studio XE8, Third Party Components, Tips and Tricks, Uncategorized | Leave a comment

Supports

This week I had to maintain some legacy code that uses many interfaces and supports in order to find out if a specific interface is supported:

One of the tasks I had to do is to replace the interfaces with pure Delphi objects. That’s why I wondered if there is a chance to write something similar for objects.

I played a bit and found the following:

Posted in Delphi, RAD Studio 10.2 Tokyo, Tips and Tricks, Uncategorized | 4 Comments

FreeAndNil

There are a lot of articles about the use and abuse of FreeAndNil but there is one point I really don’t like about FreeAndNil: It is not type-safe. Let’s have a look at the implementation:

The comment describes the issue: “Be careful to only pass TObjects to this routine.” That’s why I would implement it in a different way:

This code is type-safe and don’t use pointer arithmetic. Maybe I will ask Marco if there is a chance to add the generic FreeAndNil method directly to TObject.

Posted in Delphi, RAD Studio 10.2 Tokyo, Tips and Tricks, Uncategorized | 6 Comments

VirtualTreeView Version 6.6.0

I just updated the TurboPack version of the VirtualTreeView to the version 6.6.0 and asked Embarcadero to update GetIt.

Posted in Delphi, RAD Studio 10.2 Tokyo, SourceForge, Third Party Components, TurboPack, Uncategorized | Leave a comment

Nice Approach For Exception Safe Code

Maybe everyone knows the issue with code that is not exception safe. Let’s see an example:

The function MyFunction returns an instance of an object which is normally no problem. But MyFunction creates the instance and then runs further code. And in case of an exception no one “cares” about the instance and you will simply get a memory leak.

That’s why people normally avoid functions that return instances or write the code in an exception safe way:

At this point some purists would say that the Result should also be assigned to nil after it had been destroyed.

I don’t want to start a long discussion about FreeAndNil but what people, including myself, don’t like is to catch an exception in order to raise it again a moment later.

Instead the code could be written with a try-finally-block:

The tricks are:

  1. Free can be called if an instance is nil.
  2. Finally is always called.
  3. After assigning the Result no further code that could cause an exception is called.
Posted in Delphi, FireMonkey, RAD Studio 10 Seattle, RAD Studio 10.1 Berlin, RAD Studio 10.2 Tokyo, RAD Studio XE5, RAD Studio XE6, RAD Studio XE7, RAD Studio XE8, Tips and Tricks | 7 Comments

PNG Components and Tokyo

This week I received an email from Uwe Raabe that he has updated his png components under bitbucket.

That’s why I just updated the TurboPack version under GitHub.

As I mentioned in a previous post the RAD Studio 10.2 Tokyo version of TurboPack of is now located at a different place.

I will also ask Marco to update GetIt.

Posted in C++-Builder, Delphi, RAD Studio 10.2 Tokyo, Third Party Components, TurboPack, TurboPower | Leave a comment

TFile.Size 2.0

Yesterday I got a suggestion for a better implementation for TFile.Size from Stefan Glienke. Many thanks for it, Stefan.

In order to make the code compatible to other functions in System.IOUtils, I modified it in the way that I’m raising an EInOutError if there is a problem.

I could compile the code for all platforms Win32, Win64, MacOS32, iOS32, iOS64, Android32 and Linux64.

Posted in C++-Builder, Delphi, RAD Studio 10.1 Berlin, RAD Studio 10.2 Tokyo, Uncategorized | Leave a comment

TFile.Size

I use very often the System.IOUtils units with the wonderful classes/records TPath, TDirectory and TFile. They are much more comfortable than the old functions from System.SysUtils like FindFirst etc..

But there is one method I’m really missing: It is the size of a file. For sure there are some workarounds but I think that this method belongs to TFile. That’s why I wrote a small helper class:

I will try to convince Marco or Jim to add this method to the next release. So stay tuned.

Posted in C++-Builder, Delphi, RAD Studio 10.2 Tokyo, Uncategorized | 6 Comments

RAD Studio 10.2 Tokyo and TurboPack

Maybe most of you already heard that the next release of RAD Studio will be 10.2 Tokyo. Additionally to supporting Win32, Win64, MacOS, iOS and Android RAD Studio 10.2 Tokyo will support Linux64.

As always  I updated the TurboPack libraries and made them available via GetIt and hosted them under GitHub.

But this time we changed the location to a Tokyo-specific one. The reason is that it is easier to find the fitting version for your version of RAD Studio.

For RAD Studio 10.2 Tokyo I updated the suffix of the packages from ‘240’ to ‘250’. The ‘240’ 10.1 Berlin versions for RAD Studio XE are still available under GitHub.

The libraries compile for Delphi and C++Builder.

Maybe the most important change is that compression toolkit Abbrevia also works for Linux64.

Currently they libraries are:

  1. Abbrevia
  2. AsyncPro
  3. DOS command
  4. Essentials
  5. LockBox
  6. LockBox 3
  7. OnGuard FMX
  8. OnGuard VCL
  9. Orpheus
  10. PNG components
  11. PowerPDF
  12. SynEdit
  13. SysTools
  14. VirtualTreeView
Posted in C++-Builder, Delphi, FireMonkey, RAD Studio 10 Seattle, RAD Studio 10.1 Berlin, RAD Studio 10.2 Tokyo, RAD Studio XE5, RAD Studio XE6, RAD Studio XE7, RAD Studio XE8, SourceForge, Third Party Components, Tips and Tricks, TurboPack, TurboPower | Leave a comment