HP 3000 Manuals

INLINE [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

INLINE 

INLINE is an HP Pascal Option.

The INLINE compiler option causes the code for a certain routine to be
duplicated in-line wherever it is called.

Syntax 

     $INLINE$

Default       None.

Location      Heading.

The advantage of duplicating routine code in-line is that it eliminates
the overhead of routine calls.  Unlike macro expansion, it preserves
call-by-reference parameters as such and allows local parameters.  The
disadvantages are that it increases the amount of object code and
prevents recursion:  a routine whose code is duplicated in-line cannot
call itself or any other routine that calls it.

Example 

     PROCEDURE Proc1 (X,Y: Integer) $INLINE$;
        .
        .
        .
     PROCEDURE Proc2 $INLINE$
        (X,Y: Integer);
        .
        .
        .

In each compilation unit where you want to duplicate the code of a
specific routine in-line, you must specify the entire routine definition.
If you use the same routine in-line in more than one compilation unit,
put them in a separate file and use the INCLUDE compiler option to
include that file in each compilation unit.

Example 

The file procfile contains this procedure, which other compilation units
use in-line:

     PROCEDURE x (a,b : integer; VAR c : char) $INLINE$;
     BEGIN
        c := chr(a+b);
     END;

The following compilation unit uses the procedure x in-line:

     PROGRAM prog;
     BEGIN
           .
           .
           .
        $INCLUDE 'procfile'$
           .
           .
           .
     END.

The INLINE compiler option is equivalent to the INLINE procedure option.
The procedure option requires STANDARD_LEVEL 'EXT_MODCAL'; the compiler
option does not.

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 and
after the inlined code.



MPE/iX 5.0 Documentation