.


:




:

































 

 

 

 


. , - , , .

Pascal . , - , . C++ . , .

Pascal :

procedure < > ( );

begin

//

end;

 

 

procedure < > ( );

const

//

var

//

begin

//

end;

 

, .

:

 

function < > ( ):< >;

begin

//

< >:= < >;

end;

 

 

function < > ( ):< >;

const

//

var

//

begin

//

< >:= < >;

end;

 

++ :

 

< > < > ( )

{

//

return < >;

};

 

, void. , , (void).

. , , .

 

:

, , , .

Pascal:

 

function MyFun (A:integer; B:integer; C:real):real;

begin

MyFun:= (A+B)*C;

end;

 

OnClick:

 

procedure TForm1.Button1Click(Sender: TObject);

var

N1:Integer; //

N2:Integer; //

N3:Real; //

begin

N1:=StrToInt(Edit1.Text); // N1

N2:=StrToInt(Edit2.Text); // N2

N3:=StrToFloat(Edit3.Text); // N3

// MyFun Edit3

Edit3.Text:= FloatToStr(MyFun(N1,N2,N3));

end;

 

C++

 

float MyFun (int A, int B, float C)

{

return (A+B)*C;

};

 

:

 

void __fastcall TForm1::Button1Click(TObject *Sender)

{

int N1,N2; //

float N3;

 

N1 = StrToInt (Edit1->Text); // N1

N2 = StrToInt (Edit2->Text); // N2

N3 = StrToFloat (Edit3->Text); // N3

// MyFun Edit3

Edit3->Text = FloatToStr(MyFun(N1,N2,N3));

}

 

, , :

1. StrToInt (, '220') integer;

2. StrToFloat (, '3.14') real (float).

:

1. IntToStr integer ;

2. FloatToStr real (float) .

Delphi, C++ - . , , , .

(Properties) . . . , 1.2 Button ( Standard ), , .

 

1.2 Button

Caption ,
Enabled .
Height
Left , ,
Name ,
Top , ,
Visible
Width

 

. , Font, , , , Color - , Name - , Size - .

, . , Pascal:

 

Form1.Button1.Left:= 30; // Button1

//

Form1.Button1.Font.Size:= 10; //

 

, Form1 , , , . :

 

// , Button1

procedure TForm1.Button1Click(Sender: TObject);

begin //

Button1.Font.Size:= 10;

...

end; //

 

, , . :

 

with Form1 do //

begin // with

Button1.Left:= 10;

end; // with

 

C++ . Delphi:

 

Form1->Button1->Left = 30; // Button1

//

Form1->Button1->Font->Size = 10; //

 

...

 

// , Button1

void __fastcall TForm1::Button1Click(TObject *Sender)

{ //

Button1->Font->Size = 10;

...

}; //

 

, , , , . , , , ..

(Events), , , . .

, TButton 1.3.

 

1.3 TButton

OnClick ()
OnMouseDown
OnMouseUp
OnMouseMove

 

.

) ࠠ )

1.1 TButton



<== | ==>
|
:


: 2018-10-15; !; : 505 |


:

:

, - , ; , - .
==> ...

1672 - | 1682 -


© 2015-2024 lektsii.org - -

: 0.016 .