Note that this answer only lists new language features
not new VCL/FMX features.
Here are the links to the RAD Studio docwiki:
The full list from Embarcadero: What's New
See also: David I's list
To summarize:
Delphi 10.4
Delphi 10.3
Delphi 10.2 Tokyo
@
operator is only allowed when hard-casting the array.Delphi 10.1 Berlin
[weak]
, [unsafe]
and [volatile]
attributes are supported on all compilers.Delphi 10 Seattle
Delphi XE8
Delphi XE7
String-Like Operations Supported on Dynamic Arrays
Parallel Library added to the RTL
New compiler intrinsic routines (undocumented):
function IsManagedType(T: TypeIdentifier): Boolean; function HasWeakRef(T: TypeIdentifier): Boolean; function GetTypeKind(T: TypeIdentifier): TTypeKind; function IsConstValue(Value): boolean;
Delphi XE6
Delphi XE5
Delphi XE4
The following new conditionals are introduced/enabled in XE4:
AUTOREFCOUNT
CPUARM
EXTERNAL_LINKER
IOS
NEXTGEN
UNDERSCOREIMPORTNAME
WEAKREF
WEAKINSTREF
WEAKINTREF
Reintroduced support for iOS.
New dependency
directive for specifying the dependencies of an external library (undocumented until XE8).
ARC support in NextGen compilers (including TObject.DisposeOf).
Note that much of the groundwork for ARC was already in XE3, but much of it was disabled
Before the XE4 release, $IF
statements could only be terminated with $IFEND
, and the $IFDEF
, $IFNDEF
, $IFOPT
directives could only be terminated with $ENDIF
.
At XE4, this changed so that $ENDIF became an accepted terminator for $IF, $IFDEF, $IFNDEF, and $IFOPT.
Delphi XE3
AtomicExchange()
, AtomicIncrement()
, AtomicCmpExchange()
, AtomicDecrement()
Delphi XE2
Cross platform support for Mac OSX (32-bit) and iOS;
Support for Win64;
Modified RTL to support cross platform;
Packed
Now Forces Byte Alignment of Records (Pre XE2 it did not necessarily do this)
Eight new DEFINEs have been added:
ALIGN_STACK
CPUX86
CPUX64
MACOS (Mac operating system)
MACOS32
PC_MAPPED_EXCEPTIONS
PIC
WIN64
Full unit scope names are now required in your uses
clause.
{$ExcessPrecision on/off}
compiler directive (x64 only)
The build-in types differ depending on the target platform (32/64-bit)
Delphi XE
{$STRINGCHECKS}
compiler directive is ignored in XE;{$ALIGN}
directive:
The acceptable values for the {$ALIGN}
directive now include 1, 2, 4, 8, and 16.{$CODEALIGN}
directive, this sets the starting address for a procedure or function.{$STRONGLINKTYPES ON}
directiveDelphi 2010
as
operator can be used to cast an interface reference back to the object from which it was extracted.is
operator can be used to verify whether an interface reference was extracted from a certain class.TObject(SomeInterface)
.delayed
directive indicates that an external library such as a DLL is not to be loaded at declaration time but is to wait until the first call to the methodDelphi 2009
string
now maps to UnicodeString
;{$HighCharUnicode on|off}
compiler directivefunction Default(T): T
intrinsic function (Undocumented){$PointerMath on|off}
;W1057 Implicit string cast from '%s' to '%s'
,W1058 Implicit string cast with potential data loss from '%s' to '%s'
,W1059 Explicit string cast from '%s' to '%s'
,W1060 Explicit string cast with potential data loss from '%s' to '%s'
;Exit
function can take a parameter specifying a result;resourcestrings
as Widestrings;TObject
has a extra hidden pointer to TMonitor
in addition to its VMT pointer;deprecated
keyword can now have additional textDelphi 2007
Delphi 2006
static
methods and properties;strict
private/protected visibility keyword;final
keyword for virtual methods;{$METHODINFO}
directive;Delphi 2005
for ... in
loops,inline
keyword{$REGION}
/{$ENDREGION}
directivesDelphi 7
{$WARN UNSAFE_CODE ON}
TFormatSettings
structure.Delphi 6
[TCustomVariantType][68]
provides operator overloading for custom variant types
{$IFDEF MSWINDOWS}
{$IFDEF LINUX}
{$LIBPREFIX}
{$LIBSUFFIX}
{$LIBVERSION}
{$MESSAGE 'message'}
{$SetPEFlags}
{$IF}{$ELSE}
compiler directivesexperimental
, deprecated
, library
, platform
(but without additional text for deprecated)OLEVariant
{$J+}
)varargs
external functions (but only for the cdecl
calling convention)Delphi 5
No new language features, but:
Delphi 4
LongWord
and Int64
; Cardinal
is an UINT32 (before it was unsigned 31-bit value)
Real
takes 8 bytes and is the same as double
(previously it was 6 bytes);
{$REALCOMPATIBILITY ON}
compiler directive;REAL48
replaces the old 6-byte real
;resourcestrings
{$EXTERNALSYM}
and {$NODEFINE}
directivesimplements
keyword for propertiesDelphi 3
true
as -1
instead of 1 (Boolean is unchanged)packages
.out
parameters.Widestring
interface
and dispinterface
keyword and COM (dispid
) support.Delphi 2
Ansistring
replaces shortstring
as the default string typeCurrency
Variant
(for interop with OLE automation).ThreadVar
keyword.packed
keyword overrides this behavior;1899/12/30
under D1 it started at 0000/00/00
finalization
keywordregister
and stdcall
calling conventions added.packed
keyword.Just for complement the answer of Johan check this entry on my blog List of changes between versions of Delphi (Since Delphi 5)
and the excellent page The TIndex
which list most of the new features since delphi 2005 and resources about each one.
The jedi.inc file used by the Dephi JEDI project exposes a series of feature defines. If your project is MPL-compatible, you could even use it for feature detection and save yourself the trouble of reinventing that particular wheel.
For example, it defines SUPPORTS_FOR_IN
if the compiler supports enumerators. One could wrap your enumerator code in an IFDEF
checking for that define rather than checking for a particular compiler version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With