[fpc-devel] Copy function and dynamic array

LacaK lacak at zoznam.sk
Wed Feb 29 13:44:17 CET 2012


Hi *,
I found small incompatibility between Delphi and FPC.

This code:
var a,b: array of byte;
begin
     setlength(a,2);
     b:=copy(a,2,1); //<--HERE "Range check error" in FPC, Delphi 
returns empty array
end;

Delphi documentation says:
"If Index is larger than the length of S, *Copy* returns an empty string 
or array."
http://docwiki.embarcadero.com/VCL/en/System.Copy

Can it be fixed also in FPC?
L.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20120229/8d4a3d6b/attachment.html>


More information about the fpc-devel mailing list