17.1.1 ;
17.1.2 , .
17.2.1 Free
17.2.2 IBM PC/XT
17.2.3 Microsoft Word
17.2.4 .
17.3.1
17.3.2 , Free
17.3.3 ( ).
17.3.5 .
17.3.5 ,
17.4.1
(, , , , ..), .
, .
.
:
UNIT <>;
INTERFACE
< >
IMPLEMENTATION
< >
BEGIN
< >
END.
UNIT - (); ;
<> - ( );
INTERFACE - (); ;
IMPLEMENTATION - (); ;
BEGIN - ; ;
BEGIN > ;
END - - .
, , .
UNIT .
, , , .
, ,
Unit Global;
GLOBAL.PAS. .
USES <.>
USES - {);
<.> - , ; , , :
Uses CRT, Graph, Global;
|
|
USES... , .
.
USES INTERFACE, IMPLEMENTATION, , , , (.. USES).
INTERFACE.
(, , ), / .
, :
Unit Cmplx;
Interface
t
complex = record
re, im: real
end;
Procedure AddC (x, : complex; var z: complex);
Procedure MulC (x, : complex; var z: complex);
Uses Cmplx;
COMPLEX - ADDC MULC CMPLX
, .
, .
, , , , ( 65536 ). .
, (.. EXTERNAL, , INLINE - ) ( !). .
IMPLEMENTATION , .
- , , , , .
, , , ( ), . , .. , , , :
Unit Cmplx;
Interface
type
complex = record
re, im: real
end;
Procedure AddC (x, : complex; var z: complex);
Implementation
Procedure AddC;
begin
z.re:= x.re +Y.re;
z.im:= x.im +y.im
end;
end.
, , , .
.
BEGIN - BEGIN ( END ). , .
|
|
.
, , , ..:
Unit FileText;
Interface
Procedure Print(s: string);
Implementation
var
f: text; const
name = 'output.txt'; Procedure Print;
begin
WriteLn(f, s)
end;
{ : }
begin
assign(f, name);
rewrite(f);
{ }
end.
, : , . .
17. 4.7
, .
, : COMPILE, MAKE BUILD. , USES.
COMPILE USES TPU.
, () Uses Global; , UNIT DIRECTORIES, GLOBAL.TPU.
TPU ( -, TPU-).
TPU- .
- , PAS, .. , , , .
, .
PAS- ( ) - , , TPU- , .
, , , .
, , :
TPU- , .
BUILD TPU- , ( ) AS- USES .
BUILD , .
USES.
, .
, .
, :
Unit A; Unit ;
Interface Interface
Uses ; Uses ;
..............
Implementation Implementation
..............
end. end.
, USES :
|
|
Unit A; Unit ;
Interface Interface
..............
Implementation Implementation
Uses B; Uses A;
.............
end. end.
, , .
( !), , .