, , .
1) .
2) , , X0 dX.
3) .
4) .
( ) - , , . : , ; , ; , .
, , . .
. : (procedure function); , ; (_:=). .
procedure _ ( : );
cons t , ,
Type
Var
begin { }
end; { }
function _( : ): ;
const , ,
Type
Var
begin { }
_:=; { }
end; { }
, implementation .
unit Unit1;
Interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms, Dialogs;
Type
TForm1 = class(TForm)
End;
var Form1: TForm1;
Implementation
{ }
{ }
End.
- . , , .
- , .
|
|
Implementation
{$R *.dfm}
procedure _(); Forward;
Forward . .
implementation | |||||||
Function _1; | |||||||
Procedure _ { } | |||||||
Function _2 | |||||||
begin // ............... A := _2; // _2 B:= _1; // _1 | |||||||
. 1.
- , . 1. -, . :
, , . , , . . , , . , interface implementation implementation . . .
1.
: Edit1.. Edit9.
: , ( OnKeyPress) .
implementation Key Inp_Real1.
Implementation
{$R *.dfm}
Var Key: Char; { Key
Inp_Real1 }
procedure Inp_Real1; //
Begin
If Not (Key in ['0'..'9', ',', '-', '+', ., #8]) //
then Key:= #0; //
end; //
True |
False |
Key not (Key in['0'..'9', '+', '-', ,, #8]) |
key:= #0 |
. procedure Inp_Real1 |
OnKeyPress, .
|
|
Implementation
Var Key: Char; { Key
Inp_Real1 }
procedure Inp_Real1; //
Begin
If Not (Key in ['0'..'9', ',', '-', '+', ., #8]) // Key
{ }
then Key:= #0; //
end; //
procedure TForm1.LabeledEdit1KeyPress(Sender: TObject; var Key: Char);
Begin
Inp_Rea1; //
End;
procedure TForm1.LabeledEdit9KeyPress(Sender: TObject; var Key: Char);
Begin
Inp_Rea1; //
End;
Inp_Rea1 . , .
Key, Inp_Rea1, , TForm1.LabeledEdit1KeyPress(Sender: TObject; var Key: Char) - Key .
, , .
, , , , . .
, , - . , , - .
, ,
Procedure ABC(a: Real; b: Integer; : Char);
, ,
Function Fab(a,b: Real): Real;
:
-;
-, Var ;
-, procedure;
-, function ;
, Var, .
- -, .
- - , , , . - , , .
- - , , , . - Var. - .