[fpc-pascal] TStringHelper.Split() issue?

Rik van Kekem rik at graficalc.nl
Tue Mar 8 16:09:54 CET 2016

Michael Van Canneyt wrote:
>> On FPC, it returns 1, on Delphi, it returns 2. And debuging the "splited"
>> variable, on FPC I get only and "x" value, Delphi "x" and "y".
>> Is this a bug?
> Yes. Quite strange, because I have testcases for this ?

And content: string = 'x:yb'; does work correctly.

The problem is in this line (Line 1196 of syshelp.inc):
   if (LastSep<Length-1) and ((ACount=0) or (Len<ACount)) then

In this case LastSep is 2 and Length - 1 is also 2.
So the last y doesn't get into the array.


More information about the fpc-pascal mailing list