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

7- 19
Including hidden parameters ( highlighted), the parameter list that
appears as p(1,x,y,4,z) in the preceding program is:
-------------------
| |
| Value 1 |
| |
-------------------
| |
| Address of x |
| |
-------------------
| |
| Size of x |
| |
-------------------
| |
| Address of y |
| |
-------------------
| |
| Size of y |
| |
-------------------
| |
| Value 4 |
| |
-------------------
| |
| Address of z |
| |
-------------------
| |
| Size of z |
| |
-------------------
You can access these hidden parameters with the predefined functions
bitsizeof
and
sizeof
. If the UNCHECKABLE_ANYVAR procedure option is
specified,
bitsizeof
and
sizeof
return the size of the formal parameter
(for more information on UNCHECKABLE_ANYVAR, see Chapter 8 ).
Example 2
$STANDARD_LEVEL 'EXT_MODCAL'$
PROGRAM prog (output);
TYPE
t1 = ARRAY [1..20] OF integer;
t2 = ARRAY [1..11] OF integer;
VAR
v : t1;
PROCEDURE p1 (ANYVAR parm : t2);
BEGIN {p1}
writeln('Size of actual parameter = ', sizeof(parm):1);
writeln('Bit size of actual parameter = ', bitsizeof(parm):1);
END; {p2}
PROCEDURE p2 (ANYVAR parm : t2);
OPTION UNCHECKABLE_ANYVAR;
BEGIN {p2}
writeln('Size of formal parameter = ', sizeof(parm):1);
writeln('Bit size of formal parameter = ', bitsizeof(parm):1);
END; {p2}
BEGIN {prog}