HP SunSoft Pascal 4.0 Bedienungsanleitung Seite 108

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 333
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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
Seitenansicht 107
1 2 ... 103 104 105 106 107 108 109 110 111 112 113 ... 332 333

Kommentare zu diesen Handbüchern

Keine Kommentare