Solved

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

Posted on 2011-02-10
5
273 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
ID: 34867119
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
ID: 34867160
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
ID: 34867204
Thats correct
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 34868781
add them to each unit, yes

or define them in the project
0
 

Author Comment

by:cubic77
ID: 34869848
> 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 105
Is anyone willing to have a look through this code and help debug? 25 82
tidtcpserver connection lost handle 2 101
Python 3.5.2 32 virtualenv problems 3 64
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

808 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