procedure copieren;

var       i, j            : integer;
          key             : char;
          nambuf, extbuf,
          sname, ename    : string [12];

label     weiter;

begin

   repeat until bereit;
   commandzeile;
   clreol;
   write ( '  ignore / rename ' );
   repeat
      repeat until keypressed;
      key := chr ( bdos ( 6 , 255 ));
      if key in ['r','R']
      then ignore := false
      else ignore := true;
   until key in ['r','R','i','I'];
   for j := 1 to filez do
       with inhalt [j] do
       begin
       if flag
       then begin
            i := 0;
            repeat i := i + 1;
                   nambuf [i] := name [i];
            until ( i = 8 ) or ( name [i+1] = ' ' );
            nambuf [0] := chr ( i );
            i := 0;
            repeat i := i + 1;
                   extbuf [i] := ext [i];
            until ( i = 3 ) or ( ext [i+1] = ' ' );
            extbuf [0] := chr ( i );
            sname := concat ( nambuf , '.' , extbuf );
            ename := sname;
            while not uebertr ( sname , ename ) do
                  begin
                  case errflag of
                  1  : begin
                       write ( ' FEHLER 1  ' );
                       falschein;
                       delay ( 1000 );
                       goto weiter;
                       end;
                  2  : begin
                       write ( ' FEHLER 2  ' );
                       falschein;
                       delay ( 1000 );
                       goto weiter;
                       end;
                  3  : begin
                       if not ignore
                       then begin
                            commandzeile;
                            write ( ename , ' exsistiert schon. Neuer Name : ');
                            read ( ename );
                            if length ( ename ) = 0 then goto weiter;
                            for i := 1 to length ( ename ) do
                                ename [i] := upcase ( ename [i] );
                            end
                       else goto weiter;
                  end; { case }
            end; { while }
       end;
   end;
weiter:   end;
   trende;
   commandzeile;
   clreol;
   write('   Druecken Sie eine Taste !' );
   commandzeile;
end;
