type
TDimentions = record
Width : Integer;
Height: Integer;
Left : Integer;
Top : Integer;
end;
TMyRecord = packed record
D: array of TWallDimentions;
end;
var F: File of TMyRecord;
L: TLvlRecord;
I: Integer;
begin
SetLength(L.D, Lst1.Items.Count);
for I := 0 to lst1.Items.Count - 1 do
begin
L.D[I].Left := TShape(FindComponent(lst1.Items[I])).Left;
L.D[I].Top := TShape(FindComponent(lst1.Items[I])).Top;
L.D[I].Width := TShape(FindComponent(lst1.Items[I])).Width;
L.D[I].Height := TShape(FindComponent(lst1.Items[I])).Height;
end;
AssignFile(F, ExtractFilePath(Application.ExeName) + edt4.Text);
try
try
Rewrite(F);
Write(F, L);
finally
CloseFile(F);
end;
except
ShowMessage('nie dało się');
end;
end;
W lst1
Mam listę komponentów typu TShape
. Chce je (tzn. ich wymiary) zapisać do pliku, ale bezczelnie wywala mi błąd [Error] Unit1.pas(99): Type 'TMyRecord' needs finalization - not allowed in file type
. Jak temu zaradzić?