Few people know about a Delphi language feature that has been present since Delphi 1: prepending the type definition with a type keyword to make the type getting a new identity.
Each time I use it, I have to do some browsing for the consequences, and this time I wrote down some notes and created a small example program (source is also below).
WebSphere MQ has Queues where you can put and get messages. It also has Queue Managers to which you connect, and that provide queuing services and manages queues.
Both Queues and Queue Managers have names that can be up to 48 (single byte) characters long.
Those names mean totally different things, so though the have similar data types, they have a different identity.
Few people know the name Peter Sollich, as he always chose not to be a public figure (for instance, he is absent on the Outstanding Technical Achievement video).
Peter has been very important for both the Delphi and the .NET worlds: he was the original author of the 32-bit product that became the Delphi x86 compiler.
A few interesting links came up when using his name in some Google searches.
I just watched this interview with Anders Hejlsberg for the first time. This is truly an amazing interview. It’s rather long, about 1 hour, but it is so worth it. I’m not giving anything away… you’ll have to just watch and enjoy.
I am giving a few things away: trip down memory lane, putting big parts of software development history into perspective,
Since Anders has been so versatile, influential and still humble, this is a must watch for anyone in the software field. To quote Research Channel:
This episode features industry luminary, Anders Hejlsberg. Before coming to Microsoft in 1996 he was well noted for his work as the principal engineer of Turbo Pascal and the chief architect of the Delphi product line. At Microsoft, he was the architect for the Visual J++ development system and the Windows Foundation Classes (WFC). Promoted to Distinguished Engineer in 2000, Anders is the chief designer of the C# programming language and a key participant in the development of Microsoft’s .NET Framework. In this show, Anders is joined by a surprise guest. This episode of ‘Behind the Code’ is hosted by Barbara Fox – former senior security architect of cryptography and digital rights management for Microsoft.
(PS: how a video published in the C# 3 era can be so current <g>).
And if you feel for more, here, here, here, here and here are some more, are a few lists of videos where Anders speaks.
From a historic perspective, I like these most:
However, over the course of Delphi versions, compiler platforms and bitness, and not forget Free Pascal and Turbo Pascal/Borland Pascal, the matrix has become huge.
The really cool thing is that this API has been stable since 1995, and still allows you to subclass windows controls or create your own controls in a very simple way.
Note that Allen does not cover DestroyWnd or DestroyWindowHandle, but those are just counterparts of CreateWnd and CreateWindowHandle.
In normal Delphi application code, you have less Destroy overrides than Create overrides, and the same holds for control development.
Today I found out the hard way that you really need a build integration system for managing VersionInfo in Delphi applications: as of Delphi XE2 it is broken in the IDE.
Delphi XE3 / RAD Studio XE3 support
(as well as support from Delphi 5 and up)
Member Search list allows filtering on member type. Todo items are also displayed.
Pascal, new option on tab MMX | Properties | Pascal | New Entities | Methods: Empty Parameter lists. This controls how empty method, procedure and delegate parameter lists are emitted: either suppressed – pascal style, or emitted as ( ) – c-style.
Locate Type: displays a filtered list of previously parsed class and interface types. This is used to open the containing source file and locate a class inside the file. Default key binding Alt+Shift+T.
Solved bugs
Text containing line breaks and stored in XML (settings, snippets) could contain stray 0x0B (#11) characters. Solved.
An access violation at shutdown could occur in older Delphi IDEs if MMX was not docked. Solved.
If the Delphi IDE editor buffer contains a stray #0 (which is bad in itself) would cause all kinds of exception in MMX. MMX now detects stray #0’s and abort all editing operations, displaying the line:column of the bad #0 character.
Pascal: relative paths starting with \ (relative to root in drive) would not be handled correct. Solved
My point in this posting is that you should always try to write code that is semantically correct.
By writing semantically correct code, you have a much better chance of surviving a major change like a Unicode port.
The code below is semantically wrong: it worked in Delphi 7 by accident, not by design:
Like many Windows API functions, GetTempPath expects the first parameter (called nBufferLength) number of characters, not the number of bytes. Read the rest of this entry »
Edit 20140822 since originally posting, JEDI moved to a GIT repository, so I changed some URLs and added that it is up to date until Delphi XE7.
Finding the correct VERxxx conditional define for a particular Delphi version is askedbyalotofpeople.
Even the first link in the above search, does not contain the full list!
But: JCL comes to the rescue
The JCL file JEDI.INC usually (read: like 99.999% of the time) is up to that with that information soon.
Currently, it contains all the defines starting with Delphi 1, up to Delphi 2010 XE7.
In fact that file contains a lot more useful defines.
Actually, having the JCL and/or JVCL at hand is a very good practice: it is filled with high quality code that solves a lot of everyday problems.
Note:
VER190 (by some people attributed to the wrong Delphi version) is only used by Delphi 2007 for .NET (Delphi 2007 for Win32 used VER185 by itself and shares VER180 with Delphi 2006 for Win32).