para completar un poco...
Código Delphi
[-]procedure Log(Str: String; Archivo: String);
begin
with TStringList.Create do
try
try
If FileExists(Archivo) then LoadFromFile(Archivo);
except
end;
if Count > 0 then
if GetText(Strings[Count-1]) = Str then
Exit; while Count > 9 do
Delete(0);
Add(Str);
SaveToFile(Archivo);
finally
Free;
end;
end;
Saludos