![]() |
Delphi-Version ermitteln
Hallo,
gibt es eine Variable/Konstante in Delphi die mir die genaue Delphi Version gibt? Ich zeige die Version in meinen Versionsinformationen an. Aktuell verwende ich Compilerversion. Diese unterscheidet sich aber nicht zwischen 11.2 und 11.3. Gibt es da was womit ich genau identifizieren könnte, dass die EXE mit Delphi 11.3 erzeugt wurde? |
AW: Delphi-Version ermitteln
Delphi-Quellcode:
{$IF CompilerVersion = 35}
{$IF Declared(RTLVersion113)} // Delphi 11.3 {$ELSEIF Declared(RTLVersion112)} // Delphi 11.2 {$ELSEIF Declared(RTLVersion111)} // Delphi 11.1 {$ELSE} // Delphi 11.0 {$IFEND} {$IFEND} |
AW: Delphi-Version ermitteln
Und was ist mit Versionen vor 11?
|
AW: Delphi-Version ermitteln
Das gleiche in Grün nur halt mit den entsprechenden Werten.
![]() |
AW: Delphi-Version ermitteln
|
AW: Delphi-Version ermitteln
..da Delphi 11.3 keine neue Hauptversion ist - gibt es nur eine Compilerversion für Delphin 11.
Grüße Klaus |
AW: Delphi-Version ermitteln
Sie "hätten" aber auch einfach CompilerVersionen 35.0 35.1 35.2 35.3 machen können. :freak:
Gab es die RTLVersion nicht auch als Konstante? [edit] Doch, aber RTLVersion <> RTLVersionXXX und außerdem ebenfalls nur .0 für Delphi 11.3 :
Code:
CompilerVersion = 35.0;
RTLVersion = 35.00; RTLVersion111 = True; RTLVersion112 = True; RTLVersion113 = True; FireMonkeyVersion = 270;
Delphi-Quellcode:
Statt = würde ich aber besser immer nur mit <= oder >= arbeiten.
//{$IF (CompilerVersion = 35) and RTLVersion113} // 11.3 ist zwar ein Boolean, aber die Konstante existiert nicht immer -> True oder nicht existent (nie False)
{$IF (CompilerVersion = 35) and Declared(RTLVersion113)} // 11.3 {$IF (CompilerVersion = 35) and Declared(RTLVersion112)} // 11.2 {$IF (CompilerVersion = 35) and Declared(RTLVersion111)} // 11.1 {$IF (CompilerVersion = 35) and not Declared(RTLVersion111)} // 11.0 {$IF CompilerVersion = 35} // 11.x {$IF CompilerVersion = 34} // 10.4 {$IF CompilerVersion = 33} // 10.3 {$IF CompilerVersion = 32} // 10.2 {$IF CompilerVersion = 31} // 10.1 {$IF CompilerVersion = 30} // 10 {$IF CompilerVersion = 29} // XE8 {$IF CompilerVersion = 28} // XE7 ... {$IF CompilerVersion = 22} // XE ... {$IF CompilerVersion = 20.0} // 2009 {$IF CompilerVersion = 18.5} // 2007 (2007 hatte den selben Compiler wie 2006) {$IF CompilerVersion = 18.0} // 2006 {$IF CompilerVersion = 17.0} // 2005
Delphi-Quellcode:
entspricht
{$IF CompilerVersion = 22.0}
Delphi-Quellcode:
,
{$IFDEF VER220}
aber meisten will man ja nicht genau diese Version wissen, sondern ob es mindestens oder maximal diese Verison ist, bzw. ein Von-Bis ala
Delphi-Quellcode:
anstatt
{$IF (CompilerVersion >= 20) and (CompilerVersion <= 23)}
Delphi-Quellcode:
ähhh
{$IFDEF VER220}{$IFDEF VER220}{$IFDEF VER220}
Delphi-Quellcode:
{$IF Defined(VER220) or Defined(VER220) or Defined(VER220)}
|
AW: Delphi-Version ermitteln
Zitat:
Vor Delphi 11 gibt es dann nichts zu sehen. Muss ich halt für die nächsten Versionen immer pflegen. |
AW: Delphi-Version ermitteln
Bei Delphi 10.3 z.B. könnte ich das auch anscheinend gar nicht ermitteln oder gab es da noch was anderes?
Delphi-Quellcode:
// Delphi 11.3
RTLVersion = 35.00; RTLVersion111 = True; RTLVersion112 = True; RTLVersion113 = True; {$HPPEMIT '#define RTLVersionC 3500'} {$HPPEMIT '#define RTLVersion111C'} {$HPPEMIT '#define RTLVersion112C'} {$HPPEMIT '#define RTLVersion113C'}
Delphi-Quellcode:
// Delphi 10.3.3
RTLVersion = 33.00; {$HPPEMIT '#define RTLVersionC 3300'} |
AW: Delphi-Version ermitteln
Delphi-Quellcode:
{$IF CompilerVersion = 34}
{$IF Declared(RTLVersion113)} // Delphi 11.3 {$ELSEIF Declared(RTLVersion112)} // Delphi 11.2 {$ELSEIF Declared(RTLVersion111)} // Delphi 11.1 {$ELSE} // Delphi 11.0 {$IFEND} {$ELSEIF CompilerVersion = 33} {$IF Declared(RTLVersion1042)} // Delphi 10.4.2 {$ELSEIF Declared(RTLVersion1041)} // Delphi 10.4.1 {$ELSE} // Delphi 10.4 {$IFEND} {$ELSEIF CompilerVersion = 32} usw. {$IFEND} |
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:19 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz