Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 26-09-2007
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Poder: 22
FGarcia Va por buen camino
Si de hecho esas variables son globales pero en los otros procedimientos donde se usan su uso se hace "manualmente" es decir que les llamo con un boton a algo asi, en este procedimiento es el unico donde se hace en forma automatica. De hecho ya llevo toda la mañana corriendo debugs y demas cosas que se me han ocurrido pero no detecto error, como te comento si las horas y minutos no coinciden con los de la actualizacion del stringgrid todo se ejecuta ok.
Responder Con Cita
  #2  
Antiguo 26-09-2007
[basti] basti is offline
Miembro Premium
 
Registrado: ago 2004
Posts: 388
Poder: 23
basti Va por buen camino
Se me ocurre que mientras se está ejecutando el procedimiento, el timer vuelva a ejecutarse y te pueda crear algún tipo de conflicto. Prueba a deshabilitar el timer al comienzo del procedimiento y volver a habilitarlo al final.
__________________
Saludos.
Responder Con Cita
  #3  
Antiguo 26-09-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.572
Poder: 27
egostar Va camino a la fama
Probe tu código, cambiando algunas cosas por supuesto pero imagino que debe de ser algo similar lo que haces y sí pasó por cada una de las comparaciones que tienes.

aquí la imagen

y aquí el código que meti para probar.

Código Delphi [-]
procedure TForm1.FormShow(Sender: TObject);
begin
  rptHabilita := True;
  rptImprime := True;
  rpdHabilita := True;
  rpdImprime := True;

  dHora := 15;
  dMin  := 57;
  dSeg  := 30;

  pHora := 15;
  pMin  := 57;
  pSeg  := 34;

  sHora := 15;
  sMin  := 57;
  sSeg  := 38;

  tHora := 15;
  tMin  := 57;
  tSeg  := 42;
end;

No será en otro lado tu problema?

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita
  #4  
Antiguo 26-09-2007
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Poder: 22
FGarcia Va por buen camino
Cuando es la hora exacta se llama a este procedimiento el cual:

1. Ejecuta la consulta.
2. convierte la cadena iHora a un Datetime
3. Extrae los componentes de ese datetime y compara la hora
4. de acuerdo a la hora escribe en el stringgrid

Código Delphi [-]
procedure TfrmMain.ActualizaCadaHora(iHora: string; eHora: string) ;
var
  estaHora: Tdatetime;
  consultaVacia: Boolean;
  esteTotal: string ;
  etHora,etMin,etSeg,etMseg: word;
begin
  consultaVacia := False;
  with QyHora do
    begin
      Close ;
      SQL.Clear ;
      SQL.Add('SELECT COUNT(*) AS HSacos, ' +
              'SUM (Peso) AS [HTotal] ' +
              'FROM Captura WHERE (HoraFecha BETWEEN :FIni AND :FFin)');
      Parameters.ParamByName('FIni').Value := iHora;
      Parameters.ParamByName('FFin').Value := eHora;
      Open ;
      if (QyHora.RecordCount = 0) then
        consultaVacia := True;
    end;
 
  if not consultaVacia then
    begin
      //Convierto la cadena iHora a un formato de datetime
      estaHora := StrToDateTime(iHora);
      DecodeTime(estaHora, etHora,etMin,etSeg,etMseg);
      //Pruebo que este campo de la consulta no sea NULL
      if QyHora.Fields.FieldByName('HTotal').IsNull  then
        esteTotal := '0'
      else
        begin
          esteTotal := QyHora.FieldValues['HTotal'];
          esteTotal := Format('%.0n', [strtoFloat(esteTotal)]);
        end;
      case etHora of
      0:  begin
            StringGrid1.Cells[1,1] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,1] := esteTotal;
          end;
      1:  begin
            StringGrid1.Cells[1,2] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,2] := esteTotal;
          end;
      2:  begin
            StringGrid1.Cells[1,3] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,3] := esteTotal;
          end;
      3:  begin
            StringGrid1.Cells[1,4] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,4] := esteTotal;
          end;
      4:  begin
            StringGrid1.Cells[1,5] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,5] := esteTotal;
          end;
      5:  begin
            StringGrid1.Cells[1,6] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,6] := esteTotal;
          end;
      6:  begin
            StringGrid1.Cells[1,7] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,7] := esteTotal;
            Stringgrid1.TopRow := 7;
          end;
      7:  begin
            StringGrid1.Cells[1,8] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,8] := esteTotal;
          end;
      8:  begin
            StringGrid1.Cells[1,9] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,9] := esteTotal;
          end;
      9:  begin
            StringGrid1.Cells[1,10] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,10] := esteTotal;
          end;
      10: begin
            StringGrid1.Cells[1,11] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,11] := esteTotal;
          end;
      11: begin
            StringGrid1.Cells[1,12] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,12] := esteTotal;
          end;
      12: begin
            StringGrid1.Cells[1,13] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,13] := esteTotal;
          end;
      13: begin
            StringGrid1.Cells[1,14] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,14] := esteTotal;
          end;
      14: begin
            StringGrid1.Cells[1,15] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,15] := esteTotal;
            Stringgrid1.TopRow := 15;
          end;
      15: begin
            StringGrid1.Cells[1,16] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,16] := esteTotal;
          end;
      16: begin
            StringGrid1.Cells[1,17] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,17] := esteTotal;
          end;
      17: begin
            StringGrid1.Cells[1,18] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,18] := esteTotal;
          end;
      18: begin
            StringGrid1.Cells[1,19] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,19] := esteTotal;
          end;
      19: begin
            StringGrid1.Cells[1,20] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,20] := esteTotal;
          end;
      20: begin
            StringGrid1.Cells[1,21] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,21] := esteTotal;
          end;
      21: begin
            StringGrid1.Cells[1,22] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,22] := esteTotal;
          end;
      22: begin
            StringGrid1.Cells[1,23] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,23] := esteTotal;
            Stringgrid1.TopRow := 23;
          end;
      23: begin
            StringGrid1.Cells[1,24] := QyHora.FieldValues['HSacos'];
            StringGrid1.Cells[2,24] := esteTotal;
          end;
      end;
    end;
end;

como dije al principio del mensaje si la hora de generar los reportes no coincide con la actualizacion de el stringgrid los reportes se generan perfectamente, solo es en la coincidencia de hora donde ya los reportes no se generan.

Por cierto ya cambie las variables a local para evitar dudas. Y si, esa idea se me ocurrio basti de que sea un problema con la actualizacion del timer.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Ayuda con una consulta continua vaporlalibre Varios 15 05-12-2006 18:20:25
Lectura continua de Archivo friendspark API de Windows 2 02-02-2006 16:27:52
Ejecución de procedimiento almacenado jfgaliano SQL 4 12-12-2005 11:36:15
Reproduccion continua de un video avi alexmucho C++ Builder 1 09-09-2004 11:58:21
el problema continua! merlin Impresión 1 15-01-2004 15:01:18


La franja horaria es GMT +2. Ahora son las 07:59:26.


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