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

10-: 3
Formal parameters are optional. If you do not declare them, you can pass
the intrinsic actual parameters of types that would otherwise be
incompatible. Usually, programmers want this flexibility; therefore,
they rarely declare formal parameters.
If you do not declare a formal parameter, its actual parameters are
type-checked against their corresponding intrinsic parameters. Type
checking depends upon whether the intrinsic parameter is a reference,
value, or function or procedure parameter. The following subsections
explain these three cases, using these terms:
alignment-
An actual and intrinsic parameter are
compatible alignment-compatible
if the actual parameter is
aligned on the same or a larger boundary than
the intrinsic parameter. For example, a
2- or 4-byte-aligned actual parameter is
alignment-compatible with a 2-byte-aligned intrinsic
parameter. A byte-aligned actual parameter is not
alignment-compatible with a 2-byte-aligned intrinsic
parameter.
size-compatible
An actual and intrinsic parameter are
size-compatible
if the actual parameter is allocated more or the same
amount of space as the intrinsic parameter. For
example, a 2- or 4-byte actual parameter is
size-compatible with a 2-byte intrinsic parameter. A
1-byte actual parameter is not size-compatible with a
2-byte intrinsic parameter.
intrinsic-
See Table 10-1 for reference parameters; Table
compatible
10-2 for value parameters.
Reference Parameter Compatibility.
A
reference parameter
is a parameter that is passed by reference. VAR,
ANYVAR, and READONLY parameters are reference parameters.
All actual reference parameters must be alignment-compatible with their
corresponding intrinsic parameters. Actual VAR and READONLY parameters
must also be size-compatible and intrinsic-compatible with their
corresponding intrinsic parameters.
An intrinsic and an actual reference parameter are
intrinsic-compatible
if their types are in the same row of Table 10-1 . The
intrinsic
parameter type
is the type of the intrinsic parameter, as the intrinsic
file declares it. The
actual parameter type
is the type of the actual
parameter.
Table 10-1. Intrinsic-Compatible Intrinsic and Actual Reference Parameter Types
-----------------------------------------------------------------------------------------------
| | |
| Intrinsic Parameter Type | Actual Parameter Type |
| | |
-----------------------------------------------------------------------------------------------
| | |
| Array | Any type |
| | |
-----------------------------------------------------------------------------------------------
| | |
| Boolean | Boolean |
| | |
-----------------------------------------------------------------------------------------------
| | |
| Char | Char |
| | |
-----------------------------------------------------------------------------------------------
| | |
| Integer | Integer |
| | |