But thinking that the compiler itself will automagically determine the
path: that's simply not realistic.

Really ?

When the compiler reads uses section and find a "in" like here :

uses myunit in '/thepath/src/myunit.pas';

He could do something like:
...
if fpcword = 'in' then begin
IncludeSearchPath((ExtractFilePath('/thepath/src/myunit.pas'); // this
added
...
IncludeUnit('/thepath/src/myunit.pas');

The compiler already does this.

-----------------------------------
cadwal: >cat p.pp program p;

uses unita in 'Documents/unita.pp';

begin
end.

cadwal: >cat Documents/unita.pp
unit unita;

interface

implementation

end.

cadwal: >fpc p.pp
cadwal: >
-----------------------------------

But honestly: you're much better off using fpmake or lazarus packages.

The 'in' construct was/is a serious contender for "the worst idea ever" of 
Borland.

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

Reply via email to