Legacy IFEND (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Delphi Compiler Directives (List) Index


Require $IFEND to close $IF statements





Allows you to require the $IFEND directive in order to close the associated $IF statement in your code.

At the XE4 release, the Delphi compilers were changed to accept either $IFEND or $ENDIF to close $IF statements. Before XE4, only $IFEND could be used to close $IF statements. The $LEGACYIFEND directive allows you to restore the old behavior, which is useful if your code is emitting E2029 related to nested $IF and $IFDEF statements.

You can also set the $LEGACYIFEND compiler directive as follows:

  • Using the the ‑‑legacy-ifend command-line option;
  • Setting the Require $IF to be terminated by $IFEND option on the Project > Options > Delphi Compiler > Compiling page.

See Also