, (). Delphi . , , .
Delphi . Ÿ () , , . .
- begin / end. implementation :
var
Form1: TForm1;
, , . , (Form1) !
Delphi:
var _: _;
var - . , Delphi. , , :
var A, B, C: Integer;
, var :
var A, B: Integer;
C, D: String;
. , : 3.1415 ' ', . , const, , . :
const pi = 3.1415;
ZnakPi: String = ' ';
, Pi Delphi, Delphi 3,1415... , Pi Real .
, Delphi. .
, :
' ' , :
' '' - ' , . . , .
- String. String 2 . , String , : String[50]. Delphi .
Char : 'a'. , , , ( #13), ( #10). ( ANSI), #. , #0.
, - . , 0 (#0). PChar.
|
|
.
.
| Delphi Integer. , . |
, . e ( E), , , 10 : 5e25 - .
. , , 0.
| Delphi Real. Double, . , Currency(), . |
Boolean, : True () False (). True > False.
, , , , , . , .
! Windows- - , Text Caption. , , Label, Edit Caption, . , Delphi , , . , ( ):
var A, B, C: Integer;
begin
A:= 5;
B:= 10;
C:= A+B;
Label1.Caption:= C;
end;
, Caption String, - Integer. , C . IntToStr. "", , :
Label1.Caption:= IntToStr(C);
, 15, . . Edit. Text . Edit, Label Button, . Edit1 Edit2 . , Button1. Delphi , begin end. :
|
|
procedure TForm1.Button1Click(Sender: TObject);
var A, B, C: Integer; //
begin
// :
A:= Edit1.Text;
B:= Edit2.Text;
C:= A+B;
Label1.Caption:= IntToStr(C);
//
end;
Delphi - A B Integer, Text - String. StrToInt, - . A B :
A:= StrToInt(Edit1.Text);
B:= StrToInt(Edit2.Text);
A, B, C . :
Label1.Caption:= IntToStr (StrToInt (Edit1.Text)+
StrToInt (Edit2.Text));
, c (Float ing .) , Real. - FloatToStr, - StrToFloat.
, Delphi Real, "" . . , Delphi Delphi.
1. , 9/5 32(: Real, ). :
2. , .