delphi xe7 Windows #209 2
( -
,
).
, .
delphi xe 7 > File > New > VCL Forms Application
MainForm1.Position = poScreenCenter
5 :
+
*
/
-
0 - C
=
-
TEdit Standard
CalcEdit1
CalcEdit1.Text := 0;
6
TButton
PlusButton1
MinusButton1
MultiplyButton1
DivisionButton1
ClearButton1
CalcButton1
ObjectInspector
PlusButton1.Caption := '+';
MinusButton1 := '-';
MultiplyButton1 := '';
DivisionButton1 := '/'
ClearButton1 := 'C';
CalcButton1 := '=';
ClearButton1
MainForm1
:
procedure TMainForm1.ClearButton1Click(Sender: TObject);
begin
end;
-
procedure TMainForm1.ClearButton1Click(Sender: TObject);
begin
CalcEdit1.Text := '0';
end;
. .
C
CalcEdit1
Text 0.
, 0 . . .
CalcEdit1.Text string -
, 0 .
,
.
[dcc32 Error] CalcUnit1.pas(52): E2010 Incompatible types: 'string' and 'Integer'
.
- , C
0.
-
.
.
+ .
.
+, delphi
procedure TMainForm1.PlusButton1Click(Sender: TObject);
begin
end;
,
procedure TMainForm1.PlusButton1Click(Sender: TObject);
begin
A_number := StrToInt(CalcEdit1.Text);
Operation := 1;
end;
.
A_number := StrToInt(CalcEdit1.Text); // A_number
A_number
CalcUnit1.pas, ( )
Unit1.pas
{$R *.dfm}
3 :
A_number, B_number, Operation: Integer;
. . -
{$R *.dfm}
var
A_number, B_number, Operation: Integer;
A_number -
B_number -
Operation -
, , Integer - . . .
+
procedure TMainForm1.PlusButton1Click(Sender: TObject);
begin
A_number := StrToInt(CalcEdit1.Text);
Operation := 1;
end;
Operation := 1; //
.
1
, + 2 ,
+,
, 2-
.
0 9.
.
.
+
?
ActiveControl := CalcEdit1;
+ :
procedure TMainForm1.PlusButton1Click(Sender: TObject);
begin
A_number := StrToInt(CalcEdit1.Text);
Operation := 1;
ActiveControl := CalcEdit1;
end;
ActiveControl TForm
. .
MainForm1.ActiveControl := CalcEdit1;
ActiveControl
-
TMainForm1
.
ActiveControl := CalcEdit1;
, - .
=.
procedure TMainForm1.CalcButton1Click(Sender: TObject);
begin
B_number := StrToInt(CalcEdit1.Text);
case Operation of
1: begin
CalcEdit1.Text := IntToStr(A_number + B_number);
end;
end;
end;
=
B_number := StrToInt(CalcEdit1.Text);
// B_number string
// Integer
// 1 -
case Operation of
1: begin
CalcEdit1.Text := IntToStr(A_number + B_number);
// A_number -
//
//
//B_number -
//
// Integer string -
//
end;
end;
, - .
,
Operation .
.
, .
.
type
TCalcOperationTypes = (cotNone, cotAdd, cotSub, cotMult, cotDiv);
CalcUnit1.pas ( Unit1.pas - )
type
TCalcOperationTypes = (cotNone, cotAdd, cotSub, cotMult, cotDiv);
- :
type
TCalcOperationTypes = (cotNone, cotAdd, cotSub, cotMult, cotDiv);
TMainForm1 = class(TForm)
cotNone = 0 //
cotAdd = 1 //
cotSub, cotMult, cotDiv
2, 3, 4 - ,
, Operation
procedure TMainForm1.PlusButton1Click(Sender: TObject);
Operation := 1;
Operation := cotAdd;
procedure TMainForm1.CalcButton1Click(Sender: TObject);
1: begin
Operation := cotAdd;
Operation
var
//A_number, B_number, Operation: Integer;
A_number, B_number: Integer;
Operation: TCalcOperationTypes;
. . , ,
TCalcOperationTypes
, 0, 1, 2, 3, 4
, -
TCalcOperationTypes = (cotNone, cotAdd, cotSub, cotMult, cotDiv);
.
, . . -
-
.
.
,
, . .
C,
3 : , .
.
-, x, /
procedure TMainForm1.MinusButton1Click(Sender: TObject);
begin
end;
procedure TMainForm1.MultiplyButton1Click(Sender: TObject);
begin
end;
procedure TMainForm1.DivisionButton1Click(Sender: TObject);
begin
end;
MainForm1 CalcUnit1.pas
[F12], View > Forms
A_number := StrToInt(CalcEdit1.Text);
Operation := cotSub;
ActiveControl := CalcEdit1;
,
Operation := cotSub;
.
,
procedure SaveBOperandAndMakeOperation();
TMainForm1 = class(TForm)
private
procedure SaveBOperandAndMakeOperation();
private
{ Private declarations }
procedure SaveBOperandAndMakeOperation();
implementation
( implementation)
procedure TMainForm1.SaveBOperandAndMakeOperation();
begin
A_number := StrToInt(CalcEdit1.Text);
ActiveControl := CalcEdit1;
end;
procedure TMainForm1.PlusButton1Click(Sender: TObject);
begin
A_number := StrToInt(CalcEdit1.Text);
Operation := cotAdd;
ActiveControl := CalcEdit1;
end;
procedure TMainForm1.PlusButton1Click(Sender: TObject);
begin
SaveBOperandAndMakeOperation();
Operation := cotAdd;
end;
,
:
procedure TMainForm1.DivisionButton1Click(Sender: TObject);
begin
SaveBOperandAndMakeOperation();
Operation := cotDiv;
end;
procedure TMainForm1.MinusButton1Click(Sender: TObject);
begin
SaveBOperandAndMakeOperation();
Operation := cotSub;
end;
procedure TMainForm1.MultiplyButton1Click(Sender: TObject);
begin
SaveBOperandAndMakeOperation();
Operation := cotMult;
end;
, :
) :
SaveBOperandAndMakeOperation();
, , ,
- 1
.
Operation := cotMult;
Operation := cotSub;
-
) :
SaveBOperandAndMakeOperation
,
SaveBOperandAndMakeOperation
)
,
A_number := StrToInt(CalcEdit1.Text);
ActiveControl := CalcEdit1;
SaveBOperandAndMakeOperation();
- .
.
, =
=
procedure TMainForm1.CalcButton1Click(Sender: TObject);
var
op_result: Integer;
begin
B_number := StrToInt(CalcEdit1.Text);
case Operation of
cotAdd: begin
CalcEdit1.Text := IntToStr(A_number + B_number);
end;
cotSub: begin
CalcEdit1.Text := IntToStr(A_number - B_number);
end;
cotMult: begin
CalcEdit1.Text := IntToStr(A_number * B_number);
end;
cotDiv: begin
op_result := Integer(Round(A_number / B_number));
//CalcEdit1.Text := IntToStr(A_number / B_number);
CalcEdit1.Text := IntToStr(op_result);
end;
end;
end;
,
. ,
, Integer.
?
var
op_result: Integer;
//CalcEdit1.Text := IntToStr(A_number / B_number);
// , Round Integer
op_result := Integer(Round(A_number / B_number));
CalcEdit1.Text := IntToStr(op_result); // -
//
, ,
delphi.
,
Hello, World !
Delphi.
.
,
.
?
.
2.5 + 3.3 =
2.5 is not valid integer value
-
,
.
:
SaveBOperandAndMakeOperation
SaveAOperand
, c#
c# Visual Studio 2013
calculator delphi xe 7.
zip .
: 820 Kb.
, -
.
!!!
, ,
.
.
!!!
: !
: 200 .
: +1
( ) !
: 400 .
: +2
( ) !
: 600 .
:
0
0
|
|
|
|
-, godot,
|
|
|
|
|
|
|
|
|
|
: dress - hordes 1 4
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
, , 2020 - ,
|
|
|
|
|
|
|
|
|
|
, , , .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3), (1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3), (1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
anova
|
A Knots Story |
sabotage |
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
, ,
|
|
|
|
|
|
|
, ,
|
|
|
|
|
|
|
, , cms,
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
, , ria xxl , fly snow 3d , . -
|
|
|
|
|
|
fle game engine -
|
|
|
|
|
|
- / megainformatic cms express files -
|
|
|
|
|
|
Flash, Flash - .
|
|
|
|
|
|
(multi lang), , . - (megainformatic cms social), megainformatic cms groupon, keywords gen + , .
megainformatic.ru/webjob/ -
- |
|
|
megainformatic.ru/webjob/
megainformatic.ru/webjob/ -
- |
|
|
|
|
|
,
megainformatic cms admin -
|
|
|
|
|
|
350 . |
5800 . |
3000 . |
500 . |
|
|
|
|
|
|
|
|
|
|
|
|
megainformatic cms free - Photoshop
,
Adobe Photoshop. ,
- GIMP, Corel Photo Paint .
|
|
|
|
|
|
2d 3d, , !
. ,
,
!!! ( , ! ). |
|
|
|
|
|
|
|
|
|
|
|
,
: -
350 . |
510 . |
fle game engine |
|
- , ,
, .
- - :
- |
|
|
|
|
|
|
|
|
|
|
|
, 3ds max, photoshop, c++,
directx, delphi php.
,
.
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Photoshop free,
delphi directx - , !,
mp3 - ,
megainformatic cms express -
php + my sql. |
|
|
|
|
|
|
|
|
|
|
|
,
, delphi directx 8.1 (
3d ), 3d studio max, -
Fruity Loops Studio |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|