PROGRAM retter;
(*Retter.com rettet den Textbereich nach BDOS ERROR usw.*)
VAR
  i,j:INTEGER;
  fn : STRING(.14.);
  f: TEXT;
BEGIN
 WRITE('Discette einlegen ,  RETURN dr}cken');
 READLN;
 BDOS(13);(*Disc Reset*)
 WRITE('Dateiname: ');READLN(fn);
 ASSIGN(f,fn);REWRITE(f);
 i:=$8029; (* Turbo Textbeginn *)
 REPEAT
  i:=SUCC(i);
  write(CHR(MEM(.i.)));
  write(f, CHR(MEM(.i.)));
 UNTIL NOT (MEM(.i.) IN (.13,10,32..127.))
       OR (i>=$E406 (* Turbo Textende *));
 WRITELN;
 WRITELN(f);
 CLOSE(f);
 WRITELN('Datei ',fn,' erzeugt!')
END.
