For i := 0 to ComponentCount -1 do if Components[i] is TEdit then TEdit(Components[i]).Clear ;
me da el error señalado. Los edits estan convertidos a float.
Escrito 29 enero 2011 - 10:10
For i := 0 to ComponentCount -1 do if Components[i] is TEdit then TEdit(Components[i]).Clear ;
Escrito 29 enero 2011 - 11:27
if edit.text <> '' then begin //aqui el procedimiento que convierte de string a Float end;
Escrito 29 enero 2011 - 12:42
procedure TForm1.Edit1Change(Sender: TObject); var Monto: Double; begin Monto := StrToFloatDef(TEdit(Sender).Text, 0); // Resto del código aqui... end;
Escrito 30 enero 2011 - 11:08
Escrito 30 enero 2011 - 11:21
Escrito 30 enero 2011 - 11:26
Escrito 30 enero 2011 - 11:39
Escrito 30 enero 2011 - 12:25
Mi pregunta es cuando conviertes (así sea de uno en uno) el valor de un TEdit a que lo asignas?El programa lo tengo hecho pero claro convirtiendo los edits a float uno por uno.
Escrito 30 enero 2011 - 12:34
TCf.Text := FloatToStr(StrToFloatDef(Cb1.Text,0)+StrToFloatDef(Cb2.Text,0)+ StrToFloatDef(Cb05.Text,0)+StrToFloatDef(Cb02.Text,0)+StrToFloatDef(Cb01.Text,0)+ StrToFloatDef(Cb5.Text,0)+StrToFloatDef(Cb10.Text,0)) ;
Escrito 30 enero 2011 - 01:06
For i := 0 to ComponentCount -1 do if Components is TEdit then TCf.Text := TCf.Text + TEdit(Components).Text + ' ';
Escrito 30 enero 2011 - 07:34
TCf.Text := FloatToStr(StrToFloatDef(Cb1.Text,0)+StrToFloatDef(Cb2.Text,0)+ StrToFloatDef(Cb05.Text,0)+StrToFloatDef(Cb02.Text,0)+StrToFloatDef(Cb01.Text,0)+ StrToFloatDef(Cb5.Text,0)+StrToFloatDef(Cb10.Text,0)) ;
Escrito 31 enero 2011 - 02:41
Escrito 31 enero 2011 - 06:15
procedure TForm1.Sumar(Sender: TObject); var i: integer; Total: Double; begin Total := 0; For i := 0 to ComponentCount - 1 do if Components is TEdit then if not(TEdit(Components[I]).name = 'TCF') then begin Total := Total + StrToFloatDef(TEdit(Components[I]).Text, 0); TCF.Text := FloatToStr(Total); end; end;
Escrito 01 febrero 2011 - 07:32
Escrito 05 febrero 2011 - 03:25