Examples Delphi

USING A TEXT FILE FOR AN 'ERROR LOG'
-useful creative debugging technique
const
ErrorsFile = 'ErrorLog.txt';
private
{private declarations}
ErrorLog : TStringList;
procedure TMainForm.FormCreate(Sender: TObject);
begin
ErrorLog := TStringList.Create;
end;
{placed as appropriate...}
ErrorLog.Append('description and possibly IntToStr'd variable');
procedure TMainForm.FormDestroy(Sender: TObject);
begin
ErrorLog.SaveToFile(ErrorsFile);
ErrorLog.Free;
end;