Delphi CompilerVersion Constant / Compiler Conditional Defines

   2023-02-09 学习力0
核心提示:http://delphi.wikia.com/wiki/CompilerVersion_Constant The CompilerVersion constant identifies the internal version number of the Delphi compiler.It is defined in the System unit and may be referenced either in code just as any other consta

http://delphi.wikia.com/wiki/CompilerVersion_Constant

 

The CompilerVersion constant identifies the internal version number of the Delphi compiler.

It is defined in the System unit and may be referenced either in code just as any other constant:

 

if CompilerVersion = 20 then

  sCompilerName := 'Delphi 2009';

 

or in conditional compiler expressions:

 

{$if CompilerVersion > 18}

  // Delphi 2007 or later

{$ifend}

 

The CompilerVersion constant was introduced in Delphi 6 along with conditional expressions.

In earlier Delphi versions various compiler defined VERxxx symbols are used to determine compiler versions.

CompilerVersion values and the equivalent compiler defined symbols for the Delphi versions in which the CompilerVersion constant is defined are:

Compiler CompilerVersion

Defined Symbol

Delphi XE5 26 VER260
Delphi XE4 25 VER250
Delphi XE3 24 VER240
Delphi XE2 23 VER230
Delphi XE 22 VER220
Delphi 2010 21 VER210
Delphi 2009 20 VER200
Delphi 2007 .NET 19 VER190
Delphi 2007 18.5 VER185
Delphi 2006 18 VER180
Delphi 2005 17 VER170
Delphi 8 .NET 16 VER160
Delphi 7 15 VER150
Delphi 6 14 VER140
Delphi 5 13 VER130
Delphi 4 12 VER120
Delphi 3 10 VER100
Delphi 2 9 VER90
Delphi 1 8 VER80

http://delphi.wikia.com/wiki/Borland_Compiler_Conditional_Defines

 

 

Product Name Version

Conditional Define

CompilerVersion
Embarcadero RAD Studio XE5 19.0 VER260 26
Embarcadero RAD Studio XE4 18.0 VER250 25
Embarcadero RAD Studio XE3 17.0 VER240 24
Embarcadero RAD Studio XE2 16.0 VER230 23
Embarcadero RAD Studio XE 15.0 VER220 22
Embarcadero RAD Studio 2010 14.0 VER210 21
CodeGear C++ Builder 2009 12.0 VER200 20
CodeGear Delphi 2007 for .NET 11.0 VER190 19?
CodeGear Delphi 2007 for Win32 11.0 VER180 and VER185 18, 18.5
Borland Developer Studio 2006 10.0 VER180 18
Borland Delphi 2005 9.0 VER170 17
Borland Delphi 8 for .NET 8.0 VER160 * 16
C++BuilderX  ?  ?  
Borland C#Builder 1.0 VER160 *  
Borland Delphi 7 7.0 VER150 15
Borland Kylix 3 3.0 VER140 **  
Borland C++Builder 6  ? VER140 **(!!)  
Borland Kylix 2 2.0 VER140 **  
Borland Delphi 6 6.0 VER140 ** 14
Borland Kylix 1.0 VER140 **  
Borland C++Builder 5  ? VER130 ***  
Borland Delphi 5 5.0 VER130 ***  
Borland C++Builder 4  ? VER125  
Borland Delphi 4 4.0 VER120  
Borland C++Builder 3  ? VER110 ****  
Borland Delphi 3 3.0 VER100  
Borland C++ 5  ?  ?  
Borland C++Builder 1  ? VER93  
Borland Delphi 2 2.0 VER90  
Borland C++ 4.5  ?  ?  
Borland Delphi 1.0 VER80  
Borland C++ 4  ?  ?  
Borland Pascal 7 7.0 VER70  
Borland C++ 3.1  ?  ?  
Turbo Pascal for Windows 1.5 1.5 VER70  
Turbo C++ for DOS 3  ?  ?  
Borland C++ 3  ?  ?  
Turbo C++ for Windows 3 (Win16)  ?  ?  
Turbo Pascal for Windows 1.0 1.0  ???  
Borland C++ 2  ?  ?  
Turbo Pascal 6 6.0 VER60  
Turbo C++ for DOS  ?  ?  
Turbo C for DOS 2  ?  ?  
Turbo Pascal 5.5 5.5 VER55  
Turbo C for DOS 1.5  ?  ?  
Turbo Pascal 5 5.0 VER50  
Turbo Pascal 4 4.0 VER40  
Turbo C for DOS  ?  ?  
Turbo Pascal 3 3.0  ???  
Turbo Pascal 2 2.0  ???  
Turbo Pascal 1 1.0  ???

* This conditional define is shared by the Delphi compilers used to build C#Builder 1 and Delphi 8, which do not natively support Delphi for Win32.

This define is used in the "IDE Integration Packs" that were released to Borland partners in order to allow IDE plugins like ModelMaker Code Explorer

(http://www.modelmakertools.com/code-explorer/index.html) and

Castalia (http://www.delphi-expert.com/castalia3) to be compiled.


** This conditional define is shared between C++Builder 6, Delphi 6, Kylix 1, 2, and 3

(Checking for the conditional define "LINUX" helps to determine whether the compiler is Kylix or Delphi and "BCB" can be used to determine if C++Builder is being used).


*** This conditional define is shared with C++Builder 5


**** C++Builder 3.0 used VER110 (it had its own version of the Delphi compiler included).

 

**** CompilerVersion (Delphi 6 or later) can be used with conditional directives like

{$IF CompilerVersion >= 20}  {$DEFINE CanUnicode}  {$IFEND}

or using code:

if System.CompilerVersion >= 22 then  <do something>;
 
反对 0举报 0 评论 0
 

免责声明:本文仅代表作者个人观点,与乐学笔记(本网)无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
    本网站有部分内容均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责,若因作品内容、知识产权、版权和其他问题,请及时提供相关证明等材料并与我们留言联系,本网站将在规定时间内给予删除等相关处理.

  • Delphi中的消息处理机制 delphi 方法
    每一个VCL都有一内在的消息处理机制,其基本点就是构件类接收到某些消息并把它们发送给适当的处理方法,如果没有特定的处理方法,则调用缺省的消息处理句柄。    其中mainwndproc是定义在Twincontrol类中的一个静态方法,不能被重载(Override)。它不直接处
    02-09
  • Delphi XE6 通过JavaScript API调用百度地图
    Delphi XE6 通过JavaScript API调用百度地图
    参考昨天的内容,有朋友还是问如何调用百度地图,也是,谁让咱都在国内呢,没办法,你懂的。 首先去申请个Key,然后看一下百度JavaScript的第一个例子:http://developer.baidu.com/map/jsdemo.htm下一步,就是把例子中的代码,移动TWebBrower中。 unit Unit
    02-09
  • Delphi编译/链接过程 delphi编程案例
    Delphi编译/链接过程 delphi编程案例
    下面展示了Delphi是怎样编译源文件,并且把它们链接起来,最终形成可执行文件。当Delphi编译项目(Project)时,将编译项目源文件、窗体单元和其他相关单元,在这个过程中将会发生好几件事情:首先,Object Pascal编译器把项目单元编译为二进制对象文件,然后
    02-09
  • Delphi revelations #1 – kbmMW Smart client
    Delphi 启示 #1 – kbmMW Smart client on NextGen (Android) – 作用域问题以更高级的方式使用kbmMW smart client,在Android设备上,我遇到了问题。通过继承TInvokeableVariantType,kbmMW smart client可以使用Delphi支持的特殊类型的自定义Variant,从而可
    02-09
  • Delphi 调用DLL外部函数时的指针参数
    某项目需要调用设备厂家提供的DLL的函数,厂家给了一个VB的例子,有个参数是ByRef pBuffer As Single。于是在Delphi中用buffer:array of single代替:function func(buffer:array of single;count:integer):integer;far;stdcall;external 'func.dll';调用后bu
    02-09
  • 《zw版·Halcon-delphi系列原创教程》 Halcon分
    《zw版·Halcon-delphi系列原创教程》 Halcon分类函数012,polygon,多边形为方便阅读,在不影响说明的前提下,笔者对函数进行了简化::: 用符号“**”,替换:“procedure”:: 用大写字母“X”,替换:“IHUntypedObjectX”:: 省略了字符:“const”、“OleVa
    02-09
  • 最简单的delphi启动画面(转)
    首先做一窗体,然后将BorderStyle的属性设为bsnone,放image控件,align设为alclient 然后将主程序的修改为 uses Windows, Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas' {Form2}; {$ R *.res} begin Application.Initialize; Form2:=TForm2.Cre
    02-09
  • Delphi备忘三:TCollection的使用,用Stream保
     代码unit ufrmGetFunctionDefine;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,TypInfo,  Dialogs,ufrmStockBaseCalc, StdCtrls, ComCtrls,uQEFuncManager,uWnDataSet,uDataService;type  T
    02-09
  • Delphi Dcp 和BPL的解释
    dcp = delphi compiled package,是 package 编译时跟 bpl 一起产生出来的,记录着 package 中公开的 class、procedure、function、variable、const.... 等等的名称和相对位址。package英文翻译过来就是“包”。如果 某个控件包 A 引用了 控件包 B,当 控件包
    02-09
  • Delphi面向对象学习随笔六:接口 delphi基础
    作者:巴哈姆特(转载请注明出处并保持完整) 在对象化中,类的继承是一个非常强大的机制;而更加强大的继承机制应该是来自从一个接口的继承。    本篇我们将讨论接口的特点。    首先,接口的定义方式与类相似。不同的是:类代表了一种实体,而接口代
    02-09
点击排行