pTAL Reference Manual (H06.03+)

Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual523746-005
14-14
Formal Parameter Specification
In Example 14-3 on page 14-15, the compiler treats var1 as if it were a simple
variable and treats var2 as if it were a simple pointer.
Table 14-1. Formal Parameter Specification
Expected Actual
Parameter
Formal Parameter Characteristics
Declare Formal
Parameter As: Parameter Type
Indirection
Symbol Referral
Simple variable A value or reference
parameter
STRING
*
INT
INT(32)
REAL
REAL(64)
FIXED(n)
FIXED(
*)
Value, no;
reference,
yes
No
Simple variable A value parameter UNSIGNED No No
Array or
simple pointer
A reference
parameter
STRING
INT
INT(32)
REAL
REAL(64)
FIXED(n)
Yes No
Definition structure,
referral structure, or
structure pointer
A reference
parameter
INT or STRING Yes Yes
Referral structure or
structure pointer
A reference
parameter
STRUCT Yes Yes
Constant
expression
**
(including
@identifier )
A value parameter INT
INT(32)
UNSIGNED
REAL
REAL(64)
FIXED(n)
No No
Procedure A value parameter PROC
PROC(32)
No No
* You cannot declare a STRING value parameter. The compiler reports a syntax error if you declare a STRING
value parameter.
** The data type of the expression
and of the formal parameter must match, except that you can mix the
STRING, INT, and UNSIGNED (1-16) data types, and you can mix the INT(32) and UNSIGNED(17-31) data
types.
Any of the 10 address types can be used as formal parameters.