HP 3000 Manuals

UNCHECKABLE ANYVAR [ HP Pascal/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP Pascal/iX Programmer's Guide

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.



MPE/iX 5.0 Documentation