Ver Mensaje Individual
  #1  
Antiguo 20-03-2007
El_Raso El_Raso is offline
Miembro
 
Registrado: oct 2003
Posts: 135
Reputación: 21
El_Raso Va por buen camino
Problema con Filter y EOF usando TTable

Que tal muchachos...

Estoy usando un Tquery como master (solo informativo, master) y le tengo atada una TTable a travez de un mastersource...

Mi problema radica en que la TTable la tengo con un filtro, al tratar de recorrer los campos de forma secuencial si tiene mas de un registro nunca encuentra el fin de archivo y se me hace infinito el While...

Que le falta?

Aqui le va el procedimiento...
Código Delphi [-]
procedure TFCobrosPrestamosAgricolas.PagareAlDia(Tasa: single);
var
  dd, mm, aa: Double;
begin
   Pagare.DisableControls;
  Pagare.First;
  while not Pagare.Eof do
     begin
        if PagareESTADOPAGARE.Value = 'NORMAL' then
           begin
              Pagare.Edit;
               aa := 0.0;
               mm := 0.0;
               dd := 0.0;
               DiffFecha(PagareFECHAPAGARE.Value, Date,aa, mm, dd, );
               if aa > 0 then
                 mm := mm + (aa*12);
               PagareTIEMPOENMESES.Value := trunc(mm);
               PagareTIEMPOENDIAS.Value := trunc(dd);
               if Tasa = 0 then
                   PagareMONTOINTERES.Value := (PagareMONTOBRUTO.Value * (PagarePORCIENTO.Value/100) * PagareTIEMPOENMESES.Value) + 
                                 (PagareMONTOBRUTO.Value * ((PagarePORCIENTO.Value/100)/30) * PagareTIEMPOENDIAS.Value)
               else
                 PagareMONTOINTERES.Value := (PagareMONTOBRUTO.Value * (Tasa/100) * PagareTIEMPOENMESES.Value) + 
                                 (PagareMONTOBRUTO.Value * ((Tasa/100)/30) * PagareTIEMPOENDIAS.Value);                        
               PagareMONTONETO.Value := PagareMONTOBRUTO.Value + PagareMONTOINTERES.Value;
               PagareMONTOPAGADO.Value := PagareMONTOPAGADOCAPITAL.Value + PagareMONTOPAGADOINTERES.Value;                           
               Pagare.Post;
            end;
         Pagare.Next;
      end;
   Pagare.EnableControls;
end;

He tenido que poner el if/then para preguntar por el estado porque al quitar el filtro me funciona, pero esta tabla crecera mucho, y solo quiero los pagare que su estado sea normal...

Una manito cuando puedan please...
Responder Con Cita