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

8- 8
Table 8-3. Values Returned by Haveextension(x)
------------------------------------------------------------------------------------------------
||| |
||Actual | Position of x informal parameter list p(..,n,..) |
||Parameter | where n is the last actual parameter specified in the |
| Type of Parameter | forxis | actual parameter list p(..,n) |
||Specified | |
||| |
------------------------------------------------------------------------------------------------
| |||||
|||x is before n: | xisn: | x is after n: |
|||p(.x.,n,..) | p(..,x,..) | p(..,n,.x.) |
| |||||
| Nonextension | Yes | Calling
haveextension(x)
causes a compile-time error. |
| Parameter | No | |
||| |
------------------------------------------------------------------------------------------------
-----
| |||||
| Extension Parameter | Yes | true | true | Impossible |
| |||||
------------------------------------------------------------------------------------------------
| |||||
| | No | true | Impossible, | false |
| | | | because
x=n
||
| |||||
------------------------------------------------------------------------------------------------
UNCHECKABLE ANYVAR
The UNCHECKABLE_ANYVAR procedure option specifies that ANYVAR hidden
parameters will not be created for a routine. This allows its parameter
list to be compatible with the parameter list of a routine written in a
language other than HP Pascal. (See Chapter 7 for an explanation of
ANYVAR parameters.)
Example
PROCEDURE cproc (ANYVAR ip1,ip2 : integer)
OPTION UNCHECKABLE_ANYVAR;
EXTERNAL C;
The disadvantage of UNCHECKABLE_ANYVAR is that it causes the predefined
functions
sizeof
and
bitsizeof
to return the sizes of the types of the
formal ANYVAR parameters, instead of the sizes of the actual parameters.
Example
PROGRAM prog;
TYPE
t1 : PACKED ARRAY [1..50] OF char;
t2 : PACKED ARRAY [1..100] OF char;
VAR
y : t1;
PROCEDURE p1 (ANYVAR a : t2)
OPTION UNCHECKABLE_ANYVAR;
VAR
b : t1;
i : 1..100;
BEGIN {p1}
x := sizeof(a); {x is always 100}
END; {p1}
BEGIN {prog}
END. {prog}
The UNCHECKABLE_ANYVAR option is illegal with a routine that has no
ANYVAR parameters.