Hello all,
I found a problem with dynamic arrays of shortstrings and of static
arrays. These structures are not supported in Delphi but usually work
normally in FPC (except this case). But if a dynamic array is declared
as typized constant or a variable with initial value then trying to
resize this array (using SetLength) causes the run-time error 216.
Btw, if this dynamic array is declared as a usual variable (without an
initial value), all works OK.
Example:
{$ifdef fpc}
{$mode delphi}
{$endif}
type
tArr=array[0..4]of char;
var
a:array of tArr=('0'); //OR a:array of shorstring=('0');
begin
SetLength(a,2);
a[1]:='A';
writeln(a[1]);
end.
--
Best regards,
Pavelmailto:[EMAIL PROTECTED]
___
fpc-devel maillist - [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel