begin
  {$ IFDEF VER200}
    ShowMessage ('This is Delphi 2009');
  {$ ENDIF}

  {$ IF DEFINED (VER200)}
    ShowMessage ('This is Delphi 2009');
  {$ IFEND}
end ;


2. $ IFNDEF is equivalent to $ IF NOT DEFINED (…):
Their ends are: $ ENDIF, $ IFEND; VER150 in the example is the logo of Delphi 7.

begin
  {$ IFNDEF VER150}
    ShowMessage ('This is not Delphi 7');
  {$ ENDIF}

  {$ IF NOT DEFINED (VER150)}
    ShowMessage ('This is not Delphi 7');
  {$ IFEND}
end ;


3. Or and and can be used:

begin
  {$ DEFINE AAA}
  {$ DEFINE BBB}

  {$ IF DEFINED (AAA) OR DEFINED (BBB)}
    ShowMessage ('One of the condition identifiers AAA and BBB is defined');
  {$ IFEND}

  {$ IF DEFINED (AAA) AND DEFINED (BBB)}
    ShowMessage ('Conditional identifiers AAA and BBB are defined');
  {$ IFEND}
end ;


4. You can use constants in the System unit:
I tested a lot of constants in the System unit without any problems.

begin 
  ShowMessage (FloatToStr (CompilerVersion)); {In Delphi 2009, CompilerVersion = 20.0}

  {$ IF CompilerVersion> = 17.0}
    ShowMessage ('This is Delphi 2005 or above');
  {$ IFEND}
end ;


5. Use $ IFOPT to determine the compilation switch:
Delphi is very fun, 26 letters are arranged into different switch instructions (view with Ctrl + o + o, of course, there are more switch instructions);
$ IFOPT can determine whether these instructions are turned on.
This instruction is not very common, I took a look at 2009 VCL source code, only used a total of 6 times.

begin
  {$ IFOPT B +}
    ShowMessage ('Instruction B is open');
  {$ ELSE}
    ShowMessage ('Instruction B is closed');
  {$ ENDIF}

  {$ B +}
  {$ IFOPT B +}
    ShowMessage ('Ok!');
  {$ ENDIF}
end ;