Re: [fpc-pascal] cthreads

2014-07-27 Thread Mark Morgan Lloyd
Sven Barth wrote: On 26.07.2014 19:50, leledumbo wrote: Because then all apps are linked to it, also the ones that don't need threads. Same for clocale and cwstrings. If the widestring manager could be made by ourselves, is it possible for thread manager as well? Principiall yes, but the

[fpc-pascal] SetLength procedure

2014-07-27 Thread Steve Gatenby
Could anybody enlighten me on how to make the 'SetLength' procedure into an equivalent function I have many instances of SetLength(xxx, Length(xxx)+1); Num := High(xxx); I would like to have Num := SetLength(xxx, Length(xxx)+1); or even something like Num := IncLength(xxx, 1); These are

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread Jürgen Hestermann
Am 2014-07-27 12:10, schrieb Steve Gatenby: Could anybody enlighten me on how to make the 'SetLength' procedure into an equivalent function I have many instances of SetLength(xxx, Length(xxx)+1); Num := High(xxx); What is the problem with this code? Why force these 2 commands into a

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread Steve Gatenby
It is only a personal preference, not a serious problem. I would find code in the form of ArrayLen := IncLength(ArrayName, 1); to be much more readable then SetLength(ArrayName, Length(ArrayName)+1); ArrayLen:= High(ArrayName); I was just hoping somebody may know how its done. Thanks

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread leledumbo
It is only a personal preference, not a serious problem. I would find code in the form of ArrayLen := IncLength(ArrayName, 1); to be much more readable then SetLength(ArrayName, Length(ArrayName)+1); ArrayLen:= High(ArrayName); I was just hoping somebody may know how

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread Steve Gatenby
Thanks for that - I will give it a try :) On 27/07/14 21:21, leledumbo wrote: It is only a personal preference, not a serious problem. I would find code in the form of ArrayLen := IncLength(ArrayName, 1); to be much more readable then SetLength(ArrayName, Length(ArrayName)+1);

Re: [fpc-pascal] cthreads

2014-07-27 Thread Marco van de Voort
In our previous episode, leledumbo said: Because then all apps are linked to it, also the ones that don't need threads. Same for clocale and cwstrings. If the widestring manager could be made by ourselves, is it possible for thread manager as well? You could make an own threadmanager in

Re: [fpc-pascal] cthreads

2014-07-27 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: Going back to something less labour intensive, would it be possible to have s directive which has the effect that if a procedure isn't eliminated by smartlinking then the linker should warn if a specific library hasn't been linked? ELF

Re: [fpc-pascal] cthreads

2014-07-27 Thread Sven Barth
On 27.07.2014 11:39, Mark Morgan Lloyd wrote: Sven Barth wrote: On 26.07.2014 19:50, leledumbo wrote: Because then all apps are linked to it, also the ones that don't need threads. Same for clocale and cwstrings. If the widestring manager could be made by ourselves, is it possible for thread

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread Jürgen Hestermann
Am 2014-07-27 12:51, schrieb Steve Gatenby: I would find code in the form of ArrayLen := IncLength(ArrayName, 1); to be much more readable then SetLength(ArrayName, Length(ArrayName)+1); ArrayLen:= High(ArrayName); Why? It is not clear which index ArrayLen will receive from

Re: [fpc-pascal] cthreads

2014-07-27 Thread Henry Vermaak
On Sun, Jul 27, 2014 at 02:39:58PM +0200, Sven Barth wrote: On 27.07.2014 11:39, Mark Morgan Lloyd wrote: Sven Barth wrote: On 26.07.2014 19:50, leledumbo wrote: Because then all apps are linked to it, also the ones that don't need threads. Same for clocale and cwstrings. If the widestring

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread Andreas Berger
I very seldom comment on this, or any, forum unless I have a good answer and no one else seem to have one. This case is different. I have noticed quit often here that instead of answering the question people try to reason why in the world the author of the question would even want to do this.

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread Jürgen Hestermann
Am 2014-07-27 19:28, schrieb Andreas Berger: I have noticed quit often here that instead of answering the question people try to reason why in the world the author of the question would even want to do this. Would it not be better to tell him how to do it or at the most say I don't know. I

Re: [fpc-pascal] SetLength procedure

2014-07-27 Thread Saunders, Rich
On 2014-07-27 13:28, Andreas Berger wrote: I have noticed quit often here that instead of answering the question people try to reason why in the world the author of the question would even want to do this. I agree that this is an annoying pattern on this list. I would suggest everyone at

Re: [fpc-pascal] cthreads

2014-07-27 Thread Sven Barth
On 27.07.2014 17:01, Henry Vermaak wrote: On Sun, Jul 27, 2014 at 02:39:58PM +0200, Sven Barth wrote: On 27.07.2014 11:39, Mark Morgan Lloyd wrote: Sven Barth wrote: On 26.07.2014 19:50, leledumbo wrote: Because then all apps are linked to it, also the ones that don't need threads. Same for