HP Pascal/iX Reference Manual (31502-90022)

6: 17
procedure declared in a previous procedure declaration. If a procedure
declaration includes a formal parameter list, the procedure statement
must supply the actual parameters. The actual parameters must match the
formal parameters in number, type and order. There are four kinds of
parameters:
value, reference, procedural,
and
functional
.
Actual
value parameters
are expressions that must be assignment
compatible with the formal value parameters or, in the case of value
conformant array parameters, conformable with the conformant array
schema. Actual reference parameters are variables that must be type
identical with the formal reference parameters or, in the case of
reference conformant array parameters, conformable with the conformant
array schema. Components of a packed structure cannot appear as actual
procedural or functional para meters. Actual procedural or functional
parameters are the names of procedures or functions declared in the
program. Standard procedures or functions cannot be actual parameters to
procedures or functions.
If a
procedure
or
function
that was passed as an actual parameter
accesses any entity non-locally upon activation, then the entity accessed
is one that is accessible to the procedure or function when it is passed
as a parameter. For example, suppose Procedure A uses the non-local
variable x. If A is then passed as an actual parameter to Procedure B,
it is still able to use x, even if x is not otherwise accessible from B.
The formal parameters, if any, of an actual procedural or functional
parameter must be congruent with the formal parameters of the formal
procedural or functional parameter.
Syntax
Procedure_statement:
Example
PROGRAM show_pstate(output);
PROCEDURE wow;
BEGIN
writeln('wow');
END;
PROCEDURE bow;
BEGIN
write('bow-');
wow;
END;
PROCEDURE outer (a: integer;
procedure proc_parm);
PROCEDURE inner;