Ver Mensaje Individual
  #1  
Antiguo 26-05-2013
franklindavid franklindavid is offline
Registrado
NULL
 
Registrado: may 2013
Posts: 2
Reputación: 0
franklindavid Va por buen camino
imprimir datos consecutivos en delphi

soy extremadamente exageradamente nuevo en delphi
y necesito saber como se imprimen valores en el, osea tengo este evento que ocurre cuando presiono un buttom
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
begin
p1 := 7;
p2 := 3;
p3 := 4;
p4 := 5;
label1.caption:=floattostr(p1);
label2.caption:=floattostr(p2);
label3.caption:=floattostr(p3);
label4.caption:=floattostr(p4);
while(p1<>0) or (p2<>0) or (p3<>0) or (p4<>0)do
begin
       if (p1<>0) then
       begin
            p1 := p1 -1;
            label1.caption:=floattostr(p1);
            Sleep(100);
       end;


      if (p2<>0) then
      begin
           p2 := p2 -1;
           label2.caption:=floattostr(p2);
           Sleep(100);
      end;


      if  (p3<>0) then
      begin
           p3 := p3 -1;
           label3.caption:=floattostr(p3);
           Sleep(100);
      end;

      if (p4<>0) then
      begin
           p4 := p4 -1;
           label4.caption:=floattostr(p4);
           Sleep(100);
      end;
     


end;

end;

pero nada mas me muestra el final que da 0 y yo necesito saber como mostrar paso por paso resultado por resultado de la resta hasta que llegue a 0
Responder Con Cita