HP 3000 Manuals

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


HP Pascal/iX Programmer's Guide

INLINE 

The INLINE procedure option duplicates a routine wherever the program
calls it.  It makes your program bigger, but faster.  It is worthwhile
for short routines and when speed is more important than size.

Example 

The program:

     $STANDARD_LEVEL 'EXT_MODCAL'$
     PROGRAM prog;
     VAR
        i,j,k : integer;

        PROCEDURE max (l1,l2: integer;
                       VAR l3 : integer)
                   OPTION INLINE;
        BEGIN
           IF l1 > l2 THEN
              l3 := l1
           ELSE
              l3 := l2 ;
        END;
     BEGIN
        max(10,20,i);
        max(i,j,k);
     END.

is equivalent to the program:

     PROGRAM prog;
     VAR
        i,j,k : integer;

     BEGIN

        {max(10,20,i)}

        IF 10 > 20 THEN
           i := 10
        ELSE
           i := 20;

        {max(i,j,k)}

        IF i > j THEN
           k := i
        ELSE
           k := j;
     END.

The INLINE procedure option requires STANDARD_LEVEL 'EXT_MODCAL'. The
equivalent INLINE compiler option does not.  Refer to the HP Pascal/iX 
Reference Manual or the HP Pascal/HP-UX Reference Manual, depending on
your implementation, for more information on the INLINE compiler option.

You cannot debug inline routines with a symbolic debugger.  You can debug
routines that call inline routines, but the inlined code is treated as a
single statement and skipped.  Breakpoints can only be set before or
after the inlined code.



MPE/iX 5.0 Documentation