Begin end;
, . , . , , , . Procedure Function:
Function < >: < >;
, , :
< >:= <3>;
Delphi Result:
Result:= <3>;
, ( 4.1), , , ( 4.2).
4.1.
Unit Subprograms; ( , )
Interface { }
Procedure RunMe; ( RunMe, }
Function GetValue: Integer; ( GetValue, )
Implementation { )
Procedure RunMe;
Begin
{ RunMe}
End;
RunMe; GetValue;
V:= GetValue;
( RunMe}
{ GetValue
}
{ GetValue
V}
4.2. ,
Uses Subprograms; { Subprograms) Var
V: Integer; { }
Begin
RunMe; GetValue;
V:= GetValue;
( RunMe}
{ GetValue
}
{ GetValue
V}
, . , , .
Object Pascal . , .
|
|
4.2.1.
:
Procedure <> (< 1>: < 1>;...;
< 2>: < 2>);
:
Function <> (< >): < >;
, , , , , , , .
4.2.2.
Delphi :
1. ( . Value parameter ,
); 2. .
, , , . , .
, , (. . 4.1). , , , . . , , (. 4.3).
. 4.1.