Link to home
Start Free TrialLog in
Avatar of cubic77
cubic77Flag for Finland

asked on

Where to call a INC file (that has compiler directives in it)?

Where to call a INC file that has compiler directives in it?

My INC file is like something like this:

{$DEFINE PreRelease}  
blabla    

{$IFDEF FinalRelease}
  {$OPTIMIZATION   ON}
{$ENDIF}
{$IFDEF PreRelease}
  {$OPTIMIZATION   OFF}
{$ENDIF}
blabla

Open in new window


I call this INC file in the DPR (before the main BEGIN END loop). However, the optimization is ON even if PreRelease is defined/active.
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

These are compiler directives, just put the file in the first line after interface on the unit that needs them

Unit1

interface

{$I compilers.inc}
Avatar of cubic77

ASKER

So, you mean I need to add them all over the place? I have quite few units there.
ASKER CERTIFIED SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
add them to each unit, yes

or define them in the project
Avatar of cubic77

ASKER

> or define them in the project

No. This is not working. This is actually what I am doing now: "I call this INC file in the DPR (before the main BEGIN END loop)."