Discussion:
$DEFINE / $IFDEF
(too old to reply)
Ruud
2008-09-24 14:02:13 UTC
Permalink
Hallo allemaal,


I'm rebuilding my multi processor assembler. To make it faster by
eliminating certain CPU's, I want to use DEFINE and IFDEF etc. But I
ran into a problem. Using a lot of units, it seems I have to DEFINE
the wanted CPU in every unit. Is there way to DEFINE a CPU in only one
unit in such a way that it is recognised in other units as well?

Many thanks for any help/info!


Groetjes, Ruud
Jonas Maebe
2008-09-24 15:58:47 UTC
Permalink
In article
Post by Ruud
I'm rebuilding my multi processor assembler. To make it faster by
eliminating certain CPU's, I want to use DEFINE and IFDEF etc. But I
ran into a problem. Using a lot of units, it seems I have to DEFINE
the wanted CPU in every unit. Is there way to DEFINE a CPU in only one
unit in such a way that it is recognised in other units as well?
The easiest way is to create a common include file with such defines,
and to include this file in all of your units.

You cannot export defines from one unit into another with TP/BP.


Jonas
Dr J R Stockton
2008-09-24 16:51:06 UTC
Permalink
Post by Ruud
I'm rebuilding my multi processor assembler. To make it faster by
eliminating certain CPU's, I want to use DEFINE and IFDEF etc. But I
ran into a problem. Using a lot of units, it seems I have to DEFINE
the wanted CPU in every unit. Is there way to DEFINE a CPU in only one
unit in such a way that it is recognised in other units as well?
DEFINE it in an Include file ($i...}, and include that in every unit.

--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@physics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demon.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ....|
eljainc
2008-09-24 18:29:38 UTC
Permalink
There is no way that I know of to have a global define that spans
across all
compiled units. Simply have an include file at the top of each unit
that
has the defines needed, or manually include them.

Mike
Post by Ruud
Hallo allemaal,
I'm rebuilding my multi processor assembler. To make it faster by
eliminating certain CPU's, I want to use DEFINE and IFDEF etc. But I
ran into a problem. Using a lot of units, it seems I have to DEFINE
the wanted CPU in every unit. Is there way to DEFINE a CPU in only one
unit in such a way that it is recognised in other units as well?
Many thanks for any help/info!
Groetjes, Ruud
Marco van de Voort
2008-09-24 18:43:36 UTC
Permalink
Post by Ruud
I'm rebuilding my multi processor assembler. To make it faster by
eliminating certain CPU's, I want to use DEFINE and IFDEF etc. But I
ran into a problem. Using a lot of units, it seems I have to DEFINE
the wanted CPU in every unit. Is there way to DEFINE a CPU in only one
unit in such a way that it is recognised in other units as well?
Many thanks for any help/info!
Define in includefile (as said by others), or on the commandline (=
conditional defines in the compiler tab of the IDE)
Ruud
2008-09-26 07:25:16 UTC
Permalink
Hallo allemaal,
Define in includefile ....
Works like a charm, thank you all for this tip!
or on the commandline
Just FYI, from TP 4.0 on I cannot remember ever having used the
commandline option; I only used the IDE interface. Pure for
curiousity, why would one use it, or better, even prefer it?

--
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: Ruud.C64.org
Marco van de Voort
2008-09-26 08:10:51 UTC
Permalink
Post by Ruud
Define in includefile ....
Works like a charm, thank you all for this tip!
or on the commandline
Just FYI, from TP 4.0 on I cannot remember ever having used the
commandline option; I only used the IDE interface. Pure for
curiousity, why would one use it, or better, even prefer it?
The IDE is always manual, without room for automation. This is fine if you
only have a straight program, but gets messy in other cases:

1) e.g. multiple directories some of which must be compiled with different
PATH settings. (iow to let the .tpu's of directories shared between programs
stay in the shared directory, while the mainprogram tpu's go into its own)
2) converters that generate code (e.g. file to include file)
3) a rigid build process that manually cleans old .TPUs before starting
(E.g. in case they were compiled with different defines)

etc etc.
Jim Leonard
2008-09-26 15:36:16 UTC
Permalink
Post by Ruud
Just FYI, from TP 4.0 on I cannot remember ever having used the
commandline option; I only used the IDE interface. Pure for
curiousity, why would one use it, or better, even prefer it?
If you're developing on a limited machine, like one with only 640K or
only floppy drives, it is physically smaller (75K vs. 400K for the
IDE) and uses less RAM.

Obviously, if you are developing a program on any computer made after
1992, you probably don't need to use the command-line compiler.
Daniil Baturin
2008-10-17 21:19:31 UTC
Permalink
Hello!
You can use FreePascal in TP compatibility mode and define something in
command line keys.
Actually I don't remember about theese keys in TP, but FP supports that
feature. Also, it supports external assemblers.

Continue reading on narkive:
Loading...