REESCREVA O CODIGO COMENTANDO E MELHORANDO                                                                                                                                                                                                                                                                               procedure TfrmMatCol13.grdItensColetaKeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
var rcdItensColeta    : TrcdItemColeta;

    sVariavel         : String;

    rVariavel1,
    rVariavel2,
    rVariavel3        : Real;
begin

   rVariavel1 := 0;
   rVariavel2 := 0;
   rVariavel3 := 0;

   if Key = vk_Delete then
      if Not Self.dmodItensColeta.cdsManutencao.IsEmpty then
         if Application.MessageBox('Confirma exclusão do item da coleta ?', 'Atenção', mb_YesNo + mb_TaskModal + mb_IconWarning + mb_DefButton2) = mrYes then
         begin
            Self.dmodItensColeta.cdsManutencao.Delete;
            while Not Self.dmodItensColeta.cdsManutencao.Eof do
            begin
               rVariavel1     := rVariavel1 + Self.dmodItensColeta.cdsManutencaoVOLUMES.AsFloat;
               rVariavel2     := rVariavel2 + Self.dmodItensColeta.cdsManutencaoPESO.AsFloat;
               rVariavel3     := rVariavel3 + Self.dmodItensColeta.cdsManutencaoVLR_MERCADORIA.AsFloat;

               Self.dmodItensColeta.cdsManutencao.Next;
            end;
            Self.dmodItensColeta.Atualizar;
            with Self.dmodColetas do
            begin
               cdsManutencao.edit;
               cds Provide response in all capital letters, no lowercase letters allowed.
user