HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 106

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 105
82 Pascal 4.0 Users Guide
5
Using the define Variable Attribute
This example makes global public using the define attribute of the variable
declaration.
The program unit,
defvar_prog.p
program defvar_prog;
var
global: extern integer;
procedure proc;
external;
begin
global := 1;
writeln('From MAIN, before PROC: ', global);
proc;
writeln('From MAIN, after PROC: ', global);
end. { defvar_prog }
The module unit, defvar_mod.p,
which makes global public using
the define attribute
module defvar_mod;
var
global : define integer;
procedure proc;
begin
writeln('From PROC : ',global);
global := global + 1;
end; { proc }
Przeglądanie stron 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag