Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Conexión con bases de datos (https://www.clubdelphi.com/foros/forumdisplay.php?f=2)
-   -   Problema con Filter y EOF usando TTable (https://www.clubdelphi.com/foros/showthread.php?t=41602)

El_Raso 20-03-2007 19:35:35

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...


La franja horaria es GMT +2. Ahora son las 15:52:31.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi