Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compiler directives for any Delphi version

Status
Not open for further replies.

DavidB3

Programmer
May 4, 2014
6
RO
Hi.

I want to make my code work in any Delphi version.
For this I use compiler directives. But the compiler is still not happy 100%.

Code:
{$IF Defined(Ver80) or
   Defined(Ver90) or
   Defined(Ver100) or
   Defined(Ver120) or
   Defined(Ver130) or
   Defined(Ver140) or
   Defined(Ver150) or
   Defined(Ver160) or
   Defined(Ver170) or
   Defined(Ver180) or
   Defined(Ver185) or
   Defined(Ver190)}
{$ELSE}
{$DEFINE ALREADY_UNICODE}
{$IFEND}

{$IF NOT DEFINED(ALREADY_UNICODE)}

//some Unicode functions/procedures for old Delphi versions

{$IFEND}

XE5 compiler is keep warning me about {$IFEND}. It wants {$ENDIF} or {$LEGACYIFEND ON}.
But {$ENDIF} and {$LEGACYIFEND ON} are not accepted by older versions.

What can I do?
Thank you.

Regards,
David
 
See this:
Code:
{$IfDef DefName}
...
{$Else}
...
{$EndIf}

VER80 - Delphi 1
VER90 - Delphi 2
VER100 - Delphi 3
VER120 - Delphi 4
VER130 - Delphi 5
VER140 - Delphi 6
VER150 - Delphi 7
VER160 - Delphi 8
VER170 - Delphi 2005
VER180 - Delphi 2006
VER180 - Delphi 2007
VER185 - Delphi 2007
VER200 - Delphi 2009
VER210 - Delphi 2010
VER220 - Delphi XE
VER230 - Delphi XE2
WIN32 - Indicates that the operating environment is the Win32 API.
LINUX - Indicates that the operating environment is Linux
MSWINDOWS - Indicates that the operating environment is the MS Windows
CONSOLE - Indicates that an application is being compiled as a console application

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
{$ENDIF} is accepted on Delphi 3, btw.

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top