HP Pascal/iX Reference Manual (31502-90022)

5- 10
program that imports the module.
Several identifiers may be combined in the same variable declaration if
the variables are of the same type.
HP Pascal predefines two standard variables,
input
and
output
, that are
textfiles. Formally,
VAR
input, output: text;
These standard
textfiles
commonly appear as program
parameters
and serve
as default files for various file operations. For more information on
textfiles, refer to Chapter 3 .
Every declaration of a file variable F with components of type T implies
the additional declaration of a buffer variable of type T. The buffer
variable, denoted as F^, may be used to access the current component of
the file F.
Global Variables
Global variables
are declared at the beginning of the outermost block of
a program and are available to all the procedures and functions within
that program.
Local Variables
Local variables
are variables declared within a particular procedure or
function or in the headings as parameters, and their scope is limited to
that procedure or function during the execution of the procedure or
function. When optimization is requested, the compiler will
issue warnings about local variables that are used prior to their
initialization.
Module Variables
Module variables are declared in either the EXPORT or IMPLEMENT section
of a module. Variables declared in the EXPORT part are available to all
the procedures and functions within the program which imports the
modules. Those declared in the IMPLEMENT section are only available
inside the module.
VAR
This reserved word delimits the beginning of variable declarations in an
HP Pascal program or module. A variable declaration associates an
identifier with a type. The identifier may then appear as a variable in
executable statements.
The reserved word VAR precedes one or more variable declarations. A
variable declaration consists of an
identifier
, a
colon
(:), and a
type
.
Any number of identifiers may be listed, separated by commas. These
identifiers are then variables of the same type.
The type may be any
simple, structured,
or
pointer
type. The form of the
type may be a
standard
identifier, a
declared
type identifier, or a
data
type.
VAR sections may be repeated and intermixed with CONST, TYPE, MODULE, and
IMPORT sections.
Syntax
Variable_decl: