5

The program unit, inc_prog2.p

The module unit, inc_mod2.p

The include file, include2.h

program inc_prog2;

%include "include2.h";

procedure proc; extern;

begin

global := 1;

writeln('From MAIN, before PROC: ',global); proc;

writeln('From MAIN, after PROC: ',global); end. { proc }

module inc_mod2;

define global;

%include "include2.h";

procedure proc;

begin

writeln('From PROC: ',global); global := global + 1;

end; { proc }

var

global : extern integer;

Separate Compilation

85

Page 109
Image 109
HP SunSoft Pascal 4.0 manual Program unit, incprog2.p Module unit, incmod2.p