HP 3000 Manuals

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


HP Pascal/iX Programmer's Guide

UNRESOLVED 

The UNRESOLVED procedure option prevents the compiler/linker/loader from
resolving a routine until the program calls it.  The routine must be at
level one.

To resolve a routine is to associate it with its system name.  Calling an
OPTION UNRESOLVED routine implicitly resolves it at run-time, before it
is called.  The routine must be resolvable.

Alternatively, an OPTION UNRESOLVED routine can be explicitly resolved by
calling the predefined function addr with the routine name as its
parameter.  Then addr returns a routine reference that can be assigned to
a routine variable and called with the predefined procedure call or
fcall.  If the routine cannot be resolved, addr returns nil.

Example 

     PROGRAM p (output);

     VAR
        pv : PROCEDURE;

     PROCEDURE p
               OPTION UNRESOLVED;
               EXTERNAL;

     BEGIN {p}
        p;              {This ...}

        call(addr(p));  {is equivalent to this ...}

        pv := addr(p);  {and this}
        call(pv);
     END. {p}


NOTE On the HP-UX operating system, the UNRESOLVED option causes the addr function to return nil whether or not the specified routine is resolved.


MPE/iX 5.0 Documentation