Re: ($DEFINE) seems to stay within the one .pas file
- From: "Terry Russell" <trochilus@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 10:30:04 +0930
"Christakis John" <dontemail@xxxxxxxxxxxx> wrote in message
news:sNFwe.9744$oJ.3205@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> is this the case? I use a unit in two projects and want some code not to
> appear for the second project, so I did this:
> But, it appears that this is not the case and only adding the $DEFINE to
the
> top of unit4 will it work. This means I have to edit unit4 everytime I
> compile project1 or project2? Is there another way to do this without
> saving a separate unit4.pas and having concurrent almost identical files
to
> update?
source defines , one file
project options conditional defines .. all files
include file in each, modify define in include
Delphi is weak in this area, or you could see it as :
firmly resisting non-source-local scope and build order
dependencies :-)
An in-code flag test takes almost no clocks, chances are the
code space saving is not very large.
I know, it somehow feels all dirty and wrong to check
a flag 50 times a second, yet once all the optimisation is done the
result is the CPU clocks 3GHz in the idle loop a fraction of a second
earlier. With luck the user will be blinking and won't notice it.
Cost of CPU clock 10MHz per second $1, for that you get to
check 1 millions flags per second , forever.
{$ifdef pedant}
conditions apply :-)
{$endif}
.
- Follow-Ups:
- Re: ($DEFINE) seems to stay within the one .pas file
- From: Martin Harvey
- Re: ($DEFINE) seems to stay within the one .pas file
- From: alanglloyd
- Re: ($DEFINE) seems to stay within the one .pas file
- References:
- ($DEFINE) seems to stay within the one .pas file
- From: Christakis John
- ($DEFINE) seems to stay within the one .pas file
- Prev by Date: ($DEFINE) seems to stay within the one .pas file
- Next by Date: Re: ($DEFINE) seems to stay within the one .pas file
- Previous by thread: ($DEFINE) seems to stay within the one .pas file
- Next by thread: Re: ($DEFINE) seems to stay within the one .pas file
- Index(es):