Forum > FPC development

TStringHelper Function LastIndexOf Returns Exception

(1/1)

M+AUDIO:
Hi,
As the title say's.
A bug?
Sample project attached.

---
FPC trunk r36176 Windows 7 64bit

Thaddy:
That's a bug. Plz report it on the fpc bug tracker under rtl.
I simplified it somewhat, but it is repeatable:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program lasti;uses sysutils;const  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.';begin  writeln(txt.LastIndexOf('ut').ToString); // IndexOf works correct.end.
LastIndexOf is not working at all. And it is an FPC bug in sysutils, not Lazarus.
   

M+AUDIO:
OK, thanks.
Done using your simplified version: https://bugs.freepascal.org/view.php?id=31975

Navigation

[0] Message Index

Go to full version