Versuch es mal hiermit:
Delphi-Quellcode:
type
TMyStringList = class(TStringList)
private
FCount: Integer;
public
constructor Create;
function Add(const S: string): Integer; override;
property TrueLineCount: Integer read FCount write FCount;
end;
constructor TMyStringList.Create;
begin
FCount := 0;
end;
function TMyStringList.Add(const S: string): Integer;
begin
if (Trim(S) = EmptyStr) then
Result := -1
else
begin
Result := inherited Add(S);
Inc(FCount);
end;
end;
Braucht für ne 12MB Textdatei ca. 250 ms.