Forum > FPC development
PosSetEx bug
dje:
O, BTW. This thread was started while I'm re-coding some of these routines for HighSpeed Pascal on the Atari ST. I wanted my routines to be the same as FPC, hence why I'm looking at these boundary cases.
Another interesting note is: HighSpeed Pascal returns 1 for Pos(EmptyStr, 'Pascal')
Ie: Its opinion is an empty string can be found at the start of all strings. Wow.
I guess standards matter.
Bart:
--- Quote from: marcov on December 09, 2022, 05:30:26 pm ---Maybe posex got fixed for some Delphi compatibility measure, but for non delphi compat routines, I think it is wiser to simply adapt the documentation.
--- End quote ---
So, we really want this?
--- 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";}};} ---{$mode objfpc}{$h+}uses StrUtils;var Res: SizeInt;begin Res := PosSetEx(['1'], '2', Low(Integer)); writeln('Res = ',Res);end.
--- Code: ---C:\Users\Bart\LazarusProjecten\ConsoleProjecten>fpc test.pas
Free Pascal Compiler version 3.3.1 [2022/10/11] for i386
Copyright (c) 1993-2022 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
Linking test.exe
10 lines compiled, 0.5 sec, 69808 bytes code, 4420 bytes data
C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
An unhandled exception occurred at $0040D7FF:
EAccessViolation: Access violation
$0040D7FF
--- End code ---
Bart
Navigation
[0] Message Index
[*] Previous page