<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi *,<br>
I found small incompatibility between Delphi and FPC.<br>
<br>
This code:<br>
var a,b: array of byte;<br>
begin<br>
ΚΚΚΚ setlength(a,2);<br>
ΚΚΚΚ b:=copy(a,2,1); //<--HERE "Range check error" in FPC, Delphi
returns empty array<br>
end;<br>
<br>
Delphi documentation says:<br>
"If Index is larger than the length of S, <strong class="selflink">Copy</strong>
returns an empty string or array."<br>
<a class="moz-txt-link-freetext" href="http://docwiki.embarcadero.com/VCL/en/System.Copy">http://docwiki.embarcadero.com/VCL/en/System.Copy</a> <br>
<br>
Can it be fixed also in FPC?<br>
L.<br>
</body>
</html>