HP Pascal/iX Reference Manual (31502-90022)

12- 27
FONT '0,5'$
$TITLE 'Dptcore. CONTROLNPort Data DefinitionsCONTROLO'$
.
.
.
PROCEDURE Proc1; {This is the CONTROLNfirstCONTROLO procedure}
.
.
.
The listing prints the title and comment shown above this way:
Dptcore.
Port Data Definitions
{This is the
first
procedure}
GLOBAL
GLOBAL is an HP Pascal Option.
The GLOBAL compiler option causes the compiler to generate code for the
entire compilation unit (including the outer block) and symbolic
information about global variables that allows them to be matched with
their counterparts in compilation units compiled with the EXTERNAL
compiler option. See the
HP Pascal/iX Programmer's Guide
or the
HP
Pascal/HP-UX Programmer's Guide
, depending on your implementation, for
more information.
Syntax
$GLOBAL ['{PASCAL}']$
[ {NONE } ]
Parameters
PASCAL Causes the compiler to include type-checking information in
the object file so that its global variables can be
compared to those in a compilation unit that was compiled
with $EXTERNAL 'PASCAL'$ (or its equivalent, $EXTERNAL$).
NONE Prevents the compiler from emitting type-checking
information for global variables.
Default PASCAL.
Location At front.
The GLOBAL option, in conjunction with the EXTERNAL option, enables you
to compile one program as two or more compilation units. Specify the
GLOBAL option in the compilation unit that declares all of the global
variables and contains the main program. Specify the EXTERNAL option in
each of the other compilation units (which declare routines and the
global variables that those routines use). A compilation unit cannot
contain both the GLOBAL option and the EXTERNAL option.
Example
One compilation unit:
$GLOBAL$
PROGRAM show_global (input,output);
VAR
a,b,c,d : integer;
state : Boolean;
PROCEDURE proc1; EXTERNAL;
BEGIN {Main program}
.