Last time we're covered the differenced between classic single-cast events vs .NET-style multi-cast events. This time we'll dive into an undocumented corner of the language.
Note that I do not get any royalties from the book and I highly recommend that you get your own copy – for instance at Amazon.
We have already mentioned the new semi-undocumented record helper feature in Delphi for .NET. Another undocumented and more subtle extension is the ability to initialize global variables and typed constants with simple casting and constructor calls using constant parameters.
TFoo = class
constructor Create(A, B, C: integer);
TBar = record
class operator Explicit(Value: Integer): TBar;
class operator Implicit(Value: Double): TBar;
Foo: TFoo = TFoo.Create(1, 2, 3);
Bar1: TBar = TBar(42);
Bar2: TBar = 3.14;
In native Delphi you can initialize global variables with constant expressions such as integers, floating point values and strings. In .NET this has been extended to allow initialization of object references and records using a constructor call or an implicit or explicit cast operator. This feature can’t be used for instance fields or class vars, only for global variables and typed constants, so its usefulness is a little limited. The InitializeGlobals project demonstrates this new syntax.
Note: While this is currently an undocumented feature, it is fairly safe to assume it will continue to be available in the future. For instance, the Currency type in the Borland.Delphi.System unit is implemented as a record with operator overloading and it has implicit conversion operators from Double and Integer. Without this feature, there would be no way to initialize a global Currency variable (breaking existing Win32 code).
 This existence of this new syntax was first published by Chee Whee Chua (Borland Singapore) at http://blogs.borland.com/chewy/archive/2005/11/23/22210.aspx "
Update: The new URL is: http://blogs.codegear.com/chewy/2005/11/23/22210