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 least

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 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. W

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 IncLength.

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] 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 ma

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

[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