Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Delphi 2006, se queda bloqueado... (https://www.clubdelphi.com/foros/showthread.php?t=33578)

jmlifi 11-07-2006 15:06:03

Delphi 2006, se queda bloqueado...
 
Tengo el siguiente código:
Código Delphi [-]
procedure TEdTrabajoFrm.SalvaPzas;
var
   n, PosT   : integer;
   Pedido    : longint;
   Orden     : string;
begin
   PosT  := 0;
   with TrabajosFrm do begin
     PzasTrabajo.OnNewRecord  := nil;
     try
        for n:=1 to nPzas do begin
           ExtPedidoOrden(dtPiezas[n].Cliente,Pedido,Orden);
           if dtPiezas[n].Cant>0 then begin
              inc(PosT);
              PzasTrabajo.Append;
              PzasTrabajoCODIGO.AsInteger := self.nOrden;
              PzasTrabajoPOS.AsString     := AddCeros(PosT,3);
              PzasTrabajoPEDIDO.AsInteger := Pedido;
              PzasTrabajoO_PED.AsString   := Orden;
              PzasTrabajoCANT.AsInteger   := dtPiezas[n].Cant;
              PzasTrabajoTIEMPO.AsFloat   := dtPiezas[n].Tiempo / 60; // en min
              PzasTrabajo.Post;
           end
        end
     finally
       PzasTrabajo.OnCalcfields := PzasTrabajoCalcfields
     end
   end
end;

cuando llego a "PzasTrabajoCODIGO.AsInteger := self.nOrden;" se queda bloqueado. nOrden tiene valor. ¿ a qué se debe ?

marcoszorrilla 11-07-2006 15:13:15

Prueba a comentar esa línea, a ver si el resto va bien.

Código Delphi [-]
//PzasTrabajoCODIGO.AsInteger := self.nOrden;
//o
PzasTrabajoCODIGO.AsInteger := 8;

Un Saludo.

jmlifi 11-07-2006 15:16:01

ya lo intente antes. Pero, sigue igual

mamcx 11-07-2006 15:17:26

Que valor?
Se queda bloqueado en el debugger?
Tienes al menos el primer patch de D2006?

jmlifi 11-07-2006 15:23:07

Si comento
Código Delphi [-]
//PzasTrabajoCODIGO.AsInteger := self.nOrden;
PzasTrabajoPOS.AsString     := AddCeros(PosT,3);
...
...
...

el error da en
Código Delphi [-]
PzasTrabajoPOS.AsString     := AddCeros(PosT,3);

mamcx 11-07-2006 23:26:51

Porque haces un loop con for en vez de un while?

Sera que el objeto esta null?


La franja horaria es GMT +2. Ahora son las 18:29:57.

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