Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-15 Thread fredvs
Hello Michael and Tim. Ok, you have convinced me. But sad that the most beautiful things are always the least trustworthy. > Do you make software to "play" and keep yourself busy, or do you want to > get to business and do something useful? I make software for business and open-source. But lot

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Tim Veldhuizen
On 15 Feb 2017 04:47, Michael Van Canneyt wrote: > > > > On Tue, 14 Feb 2017, fredvs wrote: > > >> Please simply use "{$unitpath }" > > > > Huh, Mattias present me yesterday a beautiful "{$unitpath }". > > > > We played together all the night, without any trouble.

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Michael Van Canneyt
On Tue, 14 Feb 2017, fredvs wrote: Please simply use "{$unitpath }" Huh, Mattias present me yesterday a beautiful "{$unitpath }". We played together all the night, without any trouble. And this morning Matt said that I may not trust in {$unitpath }, that I will only have problems, that I

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread fredvs
> Please simply use "{$unitpath }" Huh, Mattias present me yesterday a beautiful "{$unitpath }". We played together all the night, without any trouble. And this morning Matt said that I may not trust in {$unitpath }, that I will only have problems, that I should think at something else. ;-( >

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread fredvs
Oops, in previous mail, please read: ... -Fu../src ...in place of... -Fumyunit ... Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/uses-myunit-in-src-myunit-pas-tp5727626p5727668.html Sent from the Free Pascal - General mailing

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Michael Van Canneyt
On Tue, 14 Feb 2017, fredvs wrote: I hope that I will not annoy you anymore (but where to ask then). On the contrary; I found it quite amusing. ;) Yep, thanks Tim, I feel better now, I will continue to amuse you (and Michael too, see follow) ;-) ... embarking on a mission to request a

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread fredvs
>> I hope that I will not annoy you anymore (but where to ask then). > On the contrary; I found it quite amusing. ;) Yep, thanks Tim, I feel better now, I will continue to amuse you (and Michael too, see follow) ;-) > ... embarking on a mission to request a compiler extension. No more, no >

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Michael Van Canneyt
On Tue, 14 Feb 2017, fredvs wrote: Your remark shows how hard you looked for it. Is it the war ? No. It just means I established you didn't look in the documentation before embarking on a mission to request a compiler extension. No more, no less. When I learn new tools, I always read

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Jürgen Hestermann
Am 2017-02-14 um 16:02 schrieb Tim Veldhuizen: On 14/02/17 20:00, fredvs wrote: It is a difficult task to speak with gurus. Nah, it's not. They are also people... I think.. Actually, I've never seen proof that they all are, so some may actually be chimps. :) Anyway, some are standing on such

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Tim Veldhuizen
On 14/02/17 20:00, fredvs wrote: It is a difficult task to speak with gurus. Nah, it's not. They are also people... I think.. Actually, I've never seen proof that they all are, so some may actually be chimps. :) Anyway, some are standing on such a high pedestal that they feel everyone is

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread fredvs
> Your remark shows how hard you looked for it. Is it the war ? I never imagined that such local and global directives to define path of units could exist. In my mind, it was not possible that fpc could read units without that the path was defined before all. So only a fpc parameter could be

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Michael Van Canneyt
On Mon, 13 Feb 2017, fredvs wrote: I guess you are searching for {$unitpath Documents} Yes, it is a excellent solution. but then some units might not rebuild automatically, It is not a problem, all that units are part of ../src and users should not touch it when compiling demos. Many

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-14 Thread Graeme Geldenhuys
On 2017-02-13 22:02, fredvs wrote: > PS: I wish that one day fpc will publish the complete list of all the > {$something ...} that fpc can deal. There has always been one for local and global directives. Take a look at the official "Programmers Guide" PDF and see section 1.2 (Local Directives)

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> Even my name is written wrong. Sorry Mattias, really. I should use a other way to dialog, I agree it was not fun. And I will not use directive inside code (even if it is very wow). For close the débat, the "$UNITPATH" way works only if you add this on the used units: for example in the

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Mattias Gaertner
On Mon, 13 Feb 2017 16:47:38 -0700 (MST) fredvs wrote: >[...] > This works (Mathias way): That's not my way. In my opinion you should not put paths into Pascal sources and the directive should be disabled in units. >[...] > Congratulation Mathias, you come late, but you

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> You mean a duplicate of this page ;-) Excellent, thanks. To resume: This works (Michael way): program p; uses unita2 in 'Documents/unita2.pp', unita in 'Documents/unita.pp'; begin end. - This works (Mathias way): program p;

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Ralf Quint
On 2/13/2017 2:02 PM, fredvs wrote: I guess you are searching for {$unitpath Documents} Yes, it is a excellent solution. but then some units might not rebuild automatically, It is not a problem, all that units are part of ../src and users should not touch it when compiling demos. Many

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> I guess you are searching for {$unitpath Documents} Yes, it is a excellent solution. > but then some units might not rebuild automatically, It is not a problem, all that units are part of ../src and users should not touch it when compiling demos. Many thanks Mathias for this pearl. PS: I

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> unita2 can be anywhere. No, if the compiler assign the directory search path, like I explained in earlier post: - ... if fpcword = 'in' then begin ... IncludeDirectorySearchPath(ExtractFilePath('/thepath/src/myunit.pas')); // This could be added

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Mattias Gaertner
On Mon, 13 Feb 2017 09:34:09 -0700 (MST) fredvs wrote: > > The compiler already does this. > Yes, that I know, for one unit, but try this: I guess you are searching for {$unitpath Documents} The problem with this directive is that it only works correct in the program. FPC

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Michael Van Canneyt
On Mon, 13 Feb 2017, fredvs wrote: The compiler already does this. Yes, that I know, for one unit, but try this: That will not work, and it should not. unita2 can be anywhere. The compiler should not assume that the one in the Documents directory is the one you want. I just checked: I

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> The compiler already does this. Yes, that I know, for one unit, but try this: --- cadwal: >cat p.pp program p; uses unita in 'Documents/unita.pp'; begin end. cadwal: >cat Documents/unita.pp unit unita; uses unita2; interface implementation end.

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> It does. See the output I sent. Tested with fpc trunk. Ha, you just fixed now... ;-) OK, I will try with trunk. Thanks Michael. Fre;D - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> Why would you copy functionality that the OS provides out of the box ? I profit that you are here Michael ! Not everybody knows perfectly his os. Dealing with dynamically libraries helps to not oblige end-users to copy files into root-protected-directories. But, like explained, if that

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Michael Van Canneyt
On Mon, 13 Feb 2017, fredvs wrote: The compiler already does this. Huh, then..., sorry, but there is a bug, it does not work. :-( It does. See the output I sent. Tested with fpc trunk. The 'in' construct was/is a serious contender for "the worst idea ever" of Borland. If "the

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
> The compiler already does this. Huh, then..., sorry, but there is a bug, it does not work. :-( > The 'in' construct was/is a serious contender for "the worst idea ever" of > Borland. If "the compiler already does this" (adding the path of the unit into the search-path list), IMO, the use of

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Michael Van Canneyt
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

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread fredvs
Hello Graeme. OK, thanks, I will take a look. @Michael: >I don't see the point at all. I will show you later TLoadlibrary(), maybe you will see better then. Huh, and what about: ? >> But thinking that the compiler itself will automagically determine the >> path: that's simply not realistic.

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Graeme Geldenhuys
On 2017-02-12 18:25, fredvs wrote: > Yes, of course it could be a solution but I would prefer something inside > the code. AggPas (also included with fpGUI) has a build system where relative paths can be defined as code comments in the top of the program unit. Relative paths are relative to the

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Michael Van Canneyt
On Sun, 12 Feb 2017, fredvs wrote: For example, TProcess also is very os dependent and it uses "environnement" parameter (that is also very os dependent). No it is not. Every OS has an environment ? So it is exactly what I propose: a TLoadLibrary with some features adapted for

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
>> For example, TProcess also is very os dependent and it uses "environnement" >> parameter (that is also very os dependent). > No it is not. Every OS has an environment ? So it is exactly what I propose: a TLoadLibrary with some features adapted for libraries that TProcess uses for

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
> 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

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Michael Van Canneyt
On Sun, 12 Feb 2017, fredvs wrote: Loading libraries is handled by the OS, not by the compiler or the RTL and every OS has its own way to deal with dependencies. Yes but the compiler could give some command to the os too... Of course every OS has its own way to deal with dependencies but

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
> Loading libraries is handled by the OS, not by the compiler or the RTL > and every OS has its own way to deal with dependencies. Yes but the compiler could give some command to the os too... Of course every OS has its own way to deal with dependencies but that is the power of fpc, he knows

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Sven Barth
On 12.02.2017 19:25, fredvs wrote: > For example, fpc can load dynamically libraries but it is not usable if that > libraries depend on other libraries. > > It would be great (IMO) if fpc provide, unlike other compilers, some more > modern ways to use things (units, libraries, etc...) with the

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread fredvs
> Why is using -Fu hard? Yes, of course it could be a solution but I would prefer something inside the code. By the way, IMO, and it is valable for lot of languages, the way to define/use the path (of units or libraries or dependencies) is very archaic. Only LD_LIBRARY_PATH for libraries and

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Marco van de Voort
In our previous episode, Mattias Gaertner said: > > > ../someunit instead of configuring -Fu which can be obnoxious and > > > tedious.. But that's just one use case. Another use case, AFAIR was a > > > build system instead of gnu make. > > > > IMHO these are all shaky uses cases, and

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Mattias Gaertner
On Sun, 12 Feb 2017 16:17:01 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: >[...] > > One example might be when you are writing a quick program and don't want > > to send in a whole bunch of -Fu options and go into dialog boxes in > > lazarus configuring it, so you just quickly write

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Marco van de Voort
In our previous episode, Lars said: > I have found some use cases for hard coded paths in the source files.. > although these use cases are rare. I think even delphi main project DPR > file does this, if I remember correctly, but I found other uses cases > other than that. I think that is the

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Mattias Gaertner
On Sun, 12 Feb 2017 15:33:23 +0800 Tim Veldhuizen wrote: > Indeed, I can confirm Delphi does this. I think since 2009 or XE or so, > but AFAIK it doesn't need to. It does it only for the files that are > explicitly added to the project, but those are also in the dproj

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread noreply
On 2017-02-12 01:33, Tim Veldhuizen wrote: Indeed, I can confirm Delphi does this. I think since 2009 or XE or so, I'm too lazy to check right now, but I think even delphi 5 and such used paths in the dpr (project) file Would be interesting to find out the real reason, but once again, I'm

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-11 Thread Tim Veldhuizen
Indeed, I can confirm Delphi does this. I think since 2009 or XE or so, but AFAIK it doesn't need to. It does it only for the files that are explicitly added to the project, but those are also in the dproj file. And it would compile just fine without explicitly referring to the files in the

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-11 Thread Lars
On Sat, February 11, 2017 5:56 am, Fred van Stappen wrote: > > Unit names are considered to be unique, so strictly, for the compiler > there is no need to specify the path explicitly in code when the unit path > is given to the compiler when calling it from the command line. > > To do this, use

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-11 Thread Fred van Stappen
[fpc-pascal] uses myunit in '../src/myunit.pas' ? Unit names are considered to be unique, so strictly, for the compiler there is no need to specify the path explicitly in code when the unit path is given to the compiler when calling it from the command line. To do this, use the -Fu parameter when

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-10 Thread Tim Veldhuizen
Unit names are considered to be unique, so strictly, for the compiler there is no need to specify the path explicitly in code when the unit path is given to the compiler when calling it from the command line. To do this, use the -Fu parameter when calling fpc to include ../src to the unit