Why not define a specialized list?
Delphi-Quellcode:
uses ..., System.Generics.Collections;
type
TMyRecList = class(TList<Tmyrecord>)
public
procedure LoadFromFile(const Filename: string);
procedure SaveToFile(const Filename: string);
end;
Thank you , but what i wanted is to be able to update / delete items from my record then save / read again .
please read the
Delphi-Quellcode:
procedure UpdateMyRecLastName(NewLastName:string);
var
LoadingStream: TFileStream;
i, j: Integer;
myRec:Tmyrecord;
begin
SavingStream := TFileStream.Create('SAVE.test', fmCreate or fmOpenWrite or fmShareDenyWrite);
try
myRec.LastName:=NewLastName;
{
Here how to update myRec.LastName value in the LoadingStream
}
finally
SavingStream.Free;
end;
end;
procedure DeleteMyRecLastName();
var
LoadingStream: TFileStream;
i, j: Integer;
myRec:Tmyrecord;
begin
SavingStream := TFileStream.Create('SAVE.test', fmCreate or fmOpenWrite or fmShareDenyWrite);
try
{
Here how to Delete myRec.LastName value in the LoadingStream
}
finally
SavingStream.Free;
end;
end;