84
Pascal 4.0 User’s Guide
5
Using
include
Files
In the following example, the
extern
declaration for the variable
global
is in
the
include
file,
inc_prog2.p
, and is therefore included in both files. The
define
declaration in file
inc_mod2.p
cancels the
extern
definition.
The module unit,
defvar_mod2.p
, which defines
global
in a
define
declaration
module defvar_mod2;
var
global : extern integer;
define
global;
procedure proc;
begin
writeln('From PROC : ',global);
global := 1;
end; { proc }
The commands to compile and
execute
defvar_prog.p
and
defvar_mod2.p
hostname% pc -xl defvar_prog.p defvar_mod2.p
defvar_prog.p:
defvar_mod2.p:
Linking:
hostname% a.out
From MAIN, before PROC: 1
From PROC : 1
From MAIN, after PROC : 2
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......