[fpc-pascal] length for long ansistring = segment fault

ik idokan at gmail.com
Mon Dec 3 11:07:25 CET 2012


Hello,

When I try to get the length of AnsiString, it returns me segment fault.
I'm not sure if I'm doing something wrong:

var
  s : AnsiString;
  l : word;

begin
  SetLength(s, 1024);
  FillChar(s, 1024, '*');
  l := Length(s); // seg fault here
  writeln(l);
end.

Am I doing here something wrong ?

fpc 2.6.0 x86_64 linux

Thanks,
Ido



More information about the fpc-pascal mailing list