On Sat, 31 Dec 2016 11:30:26 -0300, Luiz Americo Pereira Camara <luizameri...@gmail.com> wrote:
>2016-12-31 8:18 GMT-03:00 Bo Berglund <bo.bergl...@gmail.com>: > >> On Sat, 31 Dec 2016 11:27:53 +0100, greim >> >> The Readln approach followed by splitting in a stringlist is enough of >> an improvement that I can use it. >> >> >Did you look at StrUtils.ExtractSubStr ? > >Should be faster than TStrings; > >PosWord := 1; >Word := ExtractSubstr(Line, PosWord, [' ']); >while (Word <> '') do >begin > //do work > Word := ExtractSubstr(Line, PosWord, [' ']); >end; Thanks, I did not know about this... Unfortunately the function it is not part of the Delphi StrUtils unit and I need my solution to be usable on Delphi since the bulk of the program is probably too difficult to port to FPC. It contains a lot of graphics that uses an outdated version of GLScene, which I have had to make some minimal pathces to in order to port the program up to XE5. But I feel a port to FPC would tax my abilities too much because of the 3rd party stuff that has been used... It was a good suggestion, though! And I see that the delimiter argument can be set to StdWordDelims, which takes care of virtually all whitespace stuff. Will use it whenever I code in FPC and have this problem. -- Bo Berglund Developer in Sweden _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal