[fpc-pascal] Implementing AggPas with PtcGraph

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Jun 15 14:57:01 CEST 2017


On Thu, 15 Jun 2017 07:57:14 -0400
"James Richters" <james at productionautomation.net> wrote:

> >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' ?

Project is a Lazarus/msegui thing.

> 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?

Yes, via the fpc.cfg, via @your.cfg, via include files, via FPC IDE
config or by tools like Lazarus, msegui, make, etc.

 
> >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 someone else tries to understand your program he has to learn
your way. Too many options for the same thing can be a burden.
Especially when trying to find out why a macro was not defined.

 
>[...]
> 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 ?

fpc takes the first it finds. You can see where fpc searches for configs using the -vt flag.
Alternatively you can pass @your.cfg to add a config.

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

Many IDEs have "projects". Lazarus too. They contain build options and
other stuff. The FPC IDE does not call it "project", but its
local fpc.cfg, fp.ini and fp.dsk files have a similar purpose.

Mattias



More information about the fpc-pascal mailing list