Реферат: Сортировка
fAssign(t3.main, tmp+'\~fsort-3.tmp');
fAssign(t4.main, tmp+'\~fsort-4.tmp');
fAssign(t1.inf, tmp+'\~finf-1.tmp');
fAssign(t2.inf, tmp+'\~finf-2.tmp');
fAssign(t3.inf, tmp+'\~finf-3.tmp');
fAssign(t4.inf, tmp+'\~finf-4.tmp');
fAssign(seur.main,ParamStr(1));
fAssign(dest.main,ParamStr(2));
end;
Первоначальная сортировка
procedure firstsort(var inp, out1, out2: workfile);
var i, k: longint;
begin
fReset(inp.main);
fRewrite(out1.main);
fRewrite(out2.main);
fRewrite(out1.inf);
fRewrite(out2.inf);
new(memo);
repeat
for i:=1 to memlen do
if fEof(inp.main) then
begin
i:=i-1;
break
end else fGet(inp.main, memo^[i]);
k:=i;
sortmemo(k);
for i:=1 to k do fPut(out1.main, memo^[i]);