HP SunSoft Pascal 4.0 Manuel d'utilisateur Page 105

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 333
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 104
Separate Compilation 81
5
The program unit,
pubvar_prog.p, which declares
global as public
program pubvar_prog;
public var
global: integer;
procedure proc;
external;
begin
global := 1;
writeln('From MAIN, before PROC: ', global);
proc;
writeln('From MAIN, after PROC: ', global)
end. { pubvar_prog }
The module unit, pubvar_mod.p,
which also declares global as
public
module pubvar_mod;
public var
global : integer;
procedure proc;
begin
writeln('From PROC :',global);
global := global + 1;
end; { proc }
The commands to compile and
execute pubvar_prog.p and
pubvar_mod.p
hostname% pc -xl pubvar_prog.p pubvar_mod.p
pubvar_prog.p:
pubvar_mod.p:
Linking:
hostname% a.out
From MAIN, before PROC: 1
From PROC : 1
From MAIN, after PROC: 2
Vue de la page 104
1 2 ... 100 101 102 103 104 105 106 107 108 109 110 ... 332 333

Commentaires sur ces manuels

Pas de commentaire