×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

compiler directives for any Delphi version

compiler directives for any Delphi version

compiler directives for any Delphi version

(OP)
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

RE: compiler directives for any Delphi version

See this: http://delphi.about.com/od/objectpascalide/a/compi...

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.

RE: compiler directives for any Delphi version

{$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.

RE: compiler directives for any Delphi version

(OP)
Ok, thanks for the tip.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close