Category Archives: Tips and Tricks

Tips and tricks how to avoid common mistakes or how to generally improve your code.

madExcept and XE6

Today madshi sent me a private email and announced that there will be a XE6 version of madExcept this week. I guess that most of you already know madExcept. It is a great exception handling component that shows you in … Continue reading

Posted in Delphi, RAD Studio XE6, Third Party Components, Tips and Tricks | Comments Off on madExcept and XE6

Anonymous Timer and FireMonkey

I guess that everyone knows the good old timer and its OnTimer event. There is a timer for the VCL and for FireMonkey as well which are nearly similar. In both timers there is one thing missing: I would like … Continue reading

Posted in FireMonkey, Tips and Tricks | Tagged , | Comments Off on Anonymous Timer and FireMonkey

Indexing of Strings

As everyone knows Delphi strings are 1-based. This means that they are starting at the index 1 and ending at the index “Length()”. The reason is that Borland made the huge strings compatible to the old ShortStrings that had a … Continue reading

Posted in Tips and Tricks | Tagged | Comments Off on Indexing of Strings

Record Helpers for Intrinsic Types, Part 3 – Update

As I already told you, I’m using the great record helpers for intrinsic types. XE3 already ships with the TStringHelper which is defined in System.SysUtils. I looked at the implementation and there a some parts that make me really disappointed. … Continue reading

Posted in Tips and Tricks | Tagged | Comments Off on Record Helpers for Intrinsic Types, Part 3 – Update

Record Helpers for Intrinsic Types, Part 2 – Update

This week I used some record helpers for intrinsic types and I think that they are a wonderful feature. This means that you should update at least to XE3 to use this great feature. But as always there are some … Continue reading

Posted in Tips and Tricks | Tagged | Comments Off on Record Helpers for Intrinsic Types, Part 2 – Update

Record Helpers for Intrinsic Types

I guess that most of you already heart about it. With Delphi XE3 EMBT introduced record helpers for intrinsic types. E.g. Marco Cantu and Nick Hodges already blogged about it. Just to explain what record helpers for intrinsic types are … Continue reading

Posted in Tips and Tricks | Tagged | Comments Off on Record Helpers for Intrinsic Types

IntraWeb and Session Timeout

This week I had to maintain an IntraWeb application. For those who are not familiar with IntraWeb it allows you to create a web application with Delphi. This means that you can design your web application with components and their … Continue reading

Posted in Tips and Tricks | Tagged , | Comments Off on IntraWeb and Session Timeout

GlobalConsts.pas

Today, I found another example of a common mistake, a unit with global constants. I guess most of you know this situation. There is a value that is used several times in a unit and you declare a constant for … Continue reading

Posted in Tips and Tricks | Tagged | Comments Off on GlobalConsts.pas

ObjGuard

Sometimes it happens that I would like to convert a Delphi object to an interfaces. Interfaces offer some advantages. On the one hand you can handle different objects that are not derived from a common hierarchy but share the same … Continue reading

Posted in Tips and Tricks | Tagged | Comments Off on ObjGuard

More About Records

Since records offer methods and properties they are often used to replace objects. This is possible if there is no need to use inheritance. But there is a significant difference between both. References to objects are like pointers to a … Continue reading

Posted in Tips and Tricks | Tagged | Comments Off on More About Records