HP Pascal/iX Reference Manual (31502-90022)

4-: 20
Example
PROGRAM show_pointerderef (output);
TYPE
p = ^integer;
VAR
a,b : integer;
p_array : ARRAY [1..10] OF p;
ptr : p;
BEGIN
.
p_array[a]^:= a + b;
.
writeln(ptr^ * 2); { Dereferenced pointer is operand. }
.
END.
Function Calls
A
function call
invokes the block of a standard or user defined function
and returns a value to the calling point of the program. An operator can
perform some action on this value, and, for this reason, a function
result is an expression. See Chapter 8 for a complete description of
function calls.
Example
PROGRAM show_function_call;
VAR x: integer;
FUNCTION sum (A,B: integer): integer;
BEGIN
sum := A + B;
END;
BEGIN
x:= sum (1,2) + 3;
x:= sum(x,sum(x,sum(0,1)));
END.