HP Pascal/iX Reference Manual (31502-90022)

7- 4
NOTE ANSI/IEEE770X3.97 - 1983 Standard Pascal allows the following
reserved words, LABEL, CONST, TYPE, or VAR to be used only once in
that order.
A predefined
constant, type, variable, procedure
, or
function
may be
redeclared in a declaration part. However, access to the previous
definition associated with that item is lost within the scope in which it
is redefined.
Example
PROGRAM show_declarepart;
LABEL 25;
VAR
birthday: integer;
TYPE
friends = (Joe, Simon, Leslie, Jill);
CONST
maxnuminvitee = 3;
VAR
invitee: friends;
PROCEDURE hello;
BEGIN
writeln('Hi');
END; { End of declaration part. }
BEGIN { Beginning of body. }
.
.
END.
PROCEDURE
A
procedure
is a block that is invoked with a PROCEDURE statement. A
procedure declaration consists of a procedure heading, a semicolon (;),
and a block or a directive followed by a semicolon.
The procedure heading consists of the reserved word PROCEDURE, an
identifier that specifies the procedure name, and optionally, a formal
parameter list.
A
directive
can replace the procedure block to inform the compiler of the
location of the block. FORWARD is one of the directives. Other
directives are implementation dependent. See the
HP Pascal/iX
Programmer's Guide
or the
HP Pascal/HP-UX Programmer's Guide
, depending
on your implementation, for information on other directives. A procedure
block consists of an optional declaration part and a compound statement.
Procedure declarations must occur at the end of a declaration part after
label, constant, type, and variable declarations and after the module
declarations in the outer block. Note that procedure and function
declarations may be intermixed.