Ver Mensaje Individual
  #5  
Antiguo 28-12-2006
RJNewbyte RJNewbyte is offline
Registrado
 
Registrado: dic 2006
Posts: 3
Reputación: 0
RJNewbyte Va por buen camino
Talking Resuelto

Gracias por vuestra ayuda, el problema principal era encontar un comando como TRUNC que finalmente sirvió mejor a mis intenciones que ROUND.

Ademas del problema de los tipos porque tenia que poner algunos valores como INTEGER para poder expresarlos en los EDIT.

Muchas gracias por vuestra ayuda, así da gusto comenzar.
Código Delphi [-]
procedure TForm2.Resultado(Sender: TObject);
var
HI, MI, SI, MBI, HItoS, MItoS, SIT, SF, MBF, HF: extended;
H1, H2, H3, M1, M2, S1, S2: integer;
begin
  HI := StrToFloat (edit1.text) ;  //Horas Iniciales
  MI := StrToFloat (edit2.text);   //Minutos Iniciales
  SI := StrToFloat (edit3.Text);   //Segundos Iniciales
  MBI := StrToFloat (edit4.Text);  //Megas Iniciales
  MBF := StrToFloat (edit5.Text);  //Megas Finales
  HItoS := HI * 3600;              //Horas Iniciales a Segundos
  MItoS := MI * 60;                //Minutos Iniciales a segundos
  SIT := HItoS+MItoS+SI;           //Segundos Iniciales Totales
  SF := SIT * MBF /MBI;            //Segundos Finales
  HF := SF/3600;                 //Horas Finales
  H1 := trunc (SF) div 3600;
  H2 := H1 * 3600;
  H3 := trunc (SF) mod 3600;
  M1 := H3 div 60;
  M2 := M1*60;
  S1 := H2+M2;
  S2 :=  trunc(SF)-S1;
  Edit6.Text := FloatToStr (H1);
  Edit7.Text := FloatToStr (M1);
  Edit8.Text := FloatToStr (S2);
end;
Un Saludo
Responder Con Cita