azzera_buff(buff);
  azzera_buff(old);
  while not(eof(base)) do
    begin
      old2:=old;
      old:=buff;
      read(base,buff);
      if ((cutlr(key_buff(buff))<>cutlr(key_buff(old))) {or ((buff.serie<>old.serie)} )
	 and not(comp_buff(buff,old2,c)=0)  then begin
          posit:=-2;
	  write(bas2,buff);
	  {stampa_buff(buff);}
        end
      else
        message('elminato rec '+sts(filepos(base)),1,0);
    end;
  writexy(60,6,'Fine operazione');