[fpc-devel]Dynamic array problem (FPC 1.9)

2004-01-22 Thread Pavel V. Ozerski
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


Re: [fpc-devel]Dynamic array problem (FPC 1.9)

2004-01-22 Thread Pavel V. Ozerski
Hello all,
I found also a problem with TIniFile (1.9, win32). If I try to read an
information from the same .ini file using standard TIniFile methods
from several instances of application at the same time, sometimes I
get an error opening .INI file. I think, INI file creation flags should
be supplemented with sharing-allowed constants or at least in
TIniFile.Create the lines slLines.LoadFromFile(FFileName); and
slLines.SaveToFile(FFileName); should be included into Try..Except
blocks and into Repeat..Until success block.
-- 
Best regards,
 Pavelmailto:[EMAIL PROTECTED]



___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel