Ver Mensaje Individual
  #10  
Antiguo 09-05-2017
Franceszco Franceszco is offline
Registrado
NULL
 
Registrado: may 2017
Posts: 6
Reputación: 0
Franceszco Va por buen camino
Código Delphi [-]
  if not TryStrToInt( LabeledEdit1.Text, a) then
    raise Exception.Create('El primer número es inválido');

  if not TryStrToInt( LabeledEdit2.Text, b) ...
  ...

  LabeledEdit3.Text := IntToStr( a + b );

En esta parte de la suma, me piden que se realice de StringGrid1 a StringGrid2

Estoy intentando algo asi, pero no me va...


Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var x,a,y,i:integer;
begin

   begin
   for i :=1 to Length(LabeledEdit1.Text) do
    StringGrid1.Cells[StringGrid1.ColCount -i, 0] := LabeledEdit1.Text[ Length( LabeledEdit1.Text )-i+1 ];
   end;
   begin
   for i :=1 to Length(LabeledEdit2.Text) do
    StringGrid2.Cells[StringGrid2.ColCount -i, 0] := LabeledEdit2.Text[ Length( LabeledEdit2.Text )-i+1 ];

   end;
    begin
   for x:=Length(LabeledEdit1.Text) to Length(LabeledEdit2.Text) do
    begin
   LabeledEdit3.text:= IntToStr(StrToInt(stringgrid1.cells[StringGrid1.ColCount -i, 0]) + StrToInt(stringgrid2.cells[StringGrid2.ColCount-i, 0]));
   inc(i);
    end;
    end;
    begin

       for i :=1 to Length(LabeledEdit3.Text) do
        StringGrid3.Cells[StringGrid3.ColCount -i, 0] := LabeledEdit3.Text[ Length( LabeledEdit3.Text )-i+1 ];
end;





end;

  end.
Responder Con Cita