Solved

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

Posted on 2011-02-10
5
270 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:cubic77
  • 2
  • 2
5 Comments
 
LVL 32

Expert Comment

by:ewangoya
Comment Utility
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}
0
 

Author Comment

by:cubic77
Comment Utility
So, you mean I need to add them all over the place? I have quite few units there.
0
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
Comment Utility
Thats correct
0
 
LVL 36

Expert Comment

by:Geert Gruwez
Comment Utility
add them to each unit, yes

or define them in the project
0
 

Author Comment

by:cubic77
Comment Utility
> 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)."
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now