Delphi Version Symbols for Conditional Compilation

by Mark Brooks of AIMTec Pty Ltd 11-Sept-97 (last updated November 99)

The following table indicates the symbols to check when compiling conditionally for a particular version of compiler or system.

Compiler Symbol System Symbol
Turbo Pascal 4 Ver40 DOS -
Turbo Pascal 5.0 Ver50 DOS -
Turbo Pascal 5.5 Ver55 DOS -
Turbo Pascal 6.0 Ver60 DOS -
Borland Pascal 7 Ver70 ??? ???
Delphi 1.0 Ver80 Windows 16 -
Delphi 2.0x Ver90 Windows 32 Win32
C++ Builder 1 Ver93 Windows 32 Win32
Delphi 3 Ver100 Windows 32 Win32
C++ Builder 3 Ver110 Windows 32 Win32
Delphi 4 Ver120 Windows 32 Win32
Delphi 5 Ver130 Windows 32 Win32

NB: WIN32 is defined under all 32-bit operating systems.

Examples:

{IFDEF WIN32}
  <code for 32-bit systems>
{$ENDIF}

{$IFDEF VER?}
  <code for this version>
{$ELSE}
  <code for other versions>
{$ENDIF}