TForm2=class (TForm)
First: TEdit;
Second: TEdit;
For: TButton;
Third: TEdit;
Procedure Button1Click (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
end;
Var
Form2: TForm2;
Implementation
{$R *. FMX}
Procedure TForm2. Button1Click (Sender: TObject);
Var
First: integer;
Second: integer;
Third: integer;
The begin
Third:=first + second;
end;
end.
CodePudding user response:
third. Text:=inttostr (strtointdef (first. Text, 0) + strtointdef (second. Text, 0));
CodePudding user response:
That you define variables and Edit name are the same, not the feeling is very complicated?CodePudding user response:
Looks like doesn 't help!CodePudding user response:
First, second and third already change the property to an integer,. According to still have to use so many code?CodePudding user response:
Procedure TForm2. Button1Click (Sender: TObject);The begin
Third. Text:=inttostr (strtointdef (first. Text, 0) + strtointdef (second. Text, 0));
end;
CodePudding user response:
You 'd better use Delphi 6 to begin your study, Because in Delphi6 you can search for every functions provides the and procedures else, just press F1 for help. It is the fast way for study, just try itCodePudding user response:
The