Lazarus

Free Pascal => FPC development => Topic started by: M+AUDIO on June 07, 2017, 03:54:04 pm

Title: TStringHelper Function LastIndexOf Returns Exception
Post by: M+AUDIO on June 07, 2017, 03:54:04 pm
Hi,
As the title say's.
A bug?
Sample project attached.

---
FPC trunk r36176 Windows 7 64bit
Title: Re: TStringHelper Function LastIndexOf Returns Exception
Post by: Thaddy on June 07, 2017, 06:24:24 pm
That's a bug. Plz report it on the fpc bug tracker under rtl.
I simplified it somewhat, but it is repeatable:
Code: Pascal  [Select][+][-]
  1. program lasti;
  2. uses sysutils;
  3. const
  4.   txt = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.';
  5. begin
  6.   writeln(txt.LastIndexOf('ut').ToString); // IndexOf works correct.
  7. end.

LastIndexOf is not working at all. And it is an FPC bug in sysutils, not Lazarus.
   
Title: Re: TStringHelper Function LastIndexOf Returns Exception
Post by: M+AUDIO on June 07, 2017, 08:12:10 pm
OK, thanks.
Done using your simplified version: https://bugs.freepascal.org/view.php?id=31975
TinyPortal © 2005-2018