HP SunSoft Pascal 4.0 Manuale Utente Pagina 108

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 333
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 107
84 Pascal 4.0 Users 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 := 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
Vedere la pagina 107
1 2 ... 103 104 105 106 107 108 109 110 111 112 113 ... 332 333

Commenti su questo manuale

Nessun commento