[fpc-pascal] Implementing AggPas with PtcGraph

James Richters james at productionautomation.net
Thu Jun 15 13:57:14 CEST 2017


>The idea is that you have one project per program. You can compile them randomly without changing anything.

I don't understand what you mean by 'one project per program' ?  I only have programs that I have sorted in sub directories.  I normally use the Freepascal text IDE to compile them, and sometimes the command line.   I might want to have ProgramA.pas have one define and ProgramB.pas have another, both using the same unit, is there some method to do that?

>There are already many ways to add defines. Adding another one would make it harder for newbies.
Is there some method to make a global define that is in the program itself?   I don't see how having options available makes anything harder for anyone, they can just not use such features.

>If you want a compiler define for all projects, then simply add that define in your fpc.cfg file. That is a "global options" file. I trust those will take effect even if you use the FPC Text IDE, because it is the fpc.exe binary that reads the fpc.cfg file and gets default settings from there.

Thanks for explaining that.  It looks like I can define where my units are with fpc.cfg as well and then I won't need to keep putting them on the command line.   If I put an fpc.cfg in a specific directory along with my program to be compiled, will the one in that directory override the one in \FPC\3.0.2\bin\i386-win32 ?

I'm wondering if I am missing something with reference to 'projects' is that a Lazarus thing?   How are 'projects' defined?

James

-----Original Message-----
From: fpc-pascal [mailto:fpc-pascal-bounces at lists.freepascal.org] On Behalf Of Mattias Gaertner
Sent: Thursday, June 15, 2017 6:55 AM
To: fpc-pascal at lists.freepascal.org
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

On Thu, 15 Jun 2017 06:37:41 -0400
"James Richters" <james at productionautomation.net> wrote:

>[...]
> I see, thanks for explaining.   For some reason, I was thinking it was optional to put it in the compiler, but I could also put it in the program.
> Is there no way to set a global define in each program so I could have several programs defined differently and randomly compile them without changing any settings?  

The idea is that you have one project per program. You can compile them randomly without changing anything.


> It seems some method of doing that would be very useful... but maybe not easy to implement... I suppose it probably compiles all the units first then the main program, so putting anything in the main program wouldn't be seen until it was too late.

There are already many ways to add defines. Adding another one would make it harder for newbies.

Mattias
_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list