HP Pascal/iX Programmer's Guide (31502-90023)

2-: 1
Chapter 2 Program Structure
This chapter summarizes program structure--in terms of syntax and in
terms of compilation units. For complete syntactic definitions of
programs and their components, refer to the
HP Pascal/iX Reference Manual
or the
HP Pascal/HP-UX Reference Manual
,
depending on your implementation.
Syntactic Structure
Syntactically, every HP Pascal program is composed of two major parts:
the program heading and the program block. The program block contains an
optional declaration part and a statement (executable) part.
Figure 2-1 illustrates the syntactic structure of an HP Pascal
program. For the exact syntax of a program and its components, refer to
the
HP Pascal/iX Reference Manual
or the
HP Pascal/HP-UX Reference Manual
, depending on your implementation.
Figure 2-1. Syntactic Structure of a Program
Program Heading
The program heading contains the keyword PROGRAM, the program name, and
any program parameters. The program name can be any identifier. If your
program uses the standard textfiles
input
and
output
(the default
sequential I/O files), these textfiles must be program parameters.
Program parameters--except the standard textfiles
input
,
output
, and
stderr
--must also be declared in the declaration part of the program
block.
Example
See the example in the section "Program Block" .
For more information about program parameters, see Appendix A and
Appendix B .