Delphi-Quellcode:
procedure blubb(left, right: integer; file: string);
var stream: tfilestream; s: string; i: integer;
begin
if right < left then exit;
stream := tfilestream.create(file);
try
for i := left to right do
begin
s := inttostr(i) + #13#10;
if length(s) > 4*1024 then
begin
stream.write(s[1], length(s));
s := '';
end;
end;
if length(s) > 0 then
stream.write(s[1], length(s));
finally
stream.free();
end;
end;
Ungetestet, sollte aber (so in der Art) recht schnell funktionieren, vor allem ohne den Umweg über Memos...