EXTERNAL


PLBCMP Only

 

The EXTERNAL instruction (which may be abbreviated as EXTERN) declares a subroutine name that is defined in a separately compiled module. The instruction uses the following format:

 

 

label

EXTERNAL

[{subroutine}]

 

Where:

label

Required. A Data Definition Label.

subroutine

Optional. A Character String Variable or Literal declaring the external routine name.

Flags Affected: NONE

Note the following:

  1. The subroutine defined with the EXTERNAL instruction must be called using the parameterized CALL or CALLS instructions. The actual subroutine must be defined in the separately compiled module using the ROUTINE or PROCEDURE instruction.

  2. If {subroutine} is not specified, the name of the external subroutine is the same as the label for the EXTERNAL instruction.

  3. If {subroutine} is a literal, it specifies the name of the external subroutine and entry point that is associated with the label for the EXTERNAL statement.

  4. If {subroutine} is a variable, it specifies the name of the external subroutine and entry point that is associated with the label for the EXTERNAL statement. This form allows the subroutine and module name that is dynamically assigned at run-time.

  5. The information contained in {subroutine} may include three (3) items. The format is:

"[{alias}|]{name}[;{routine}]"

{alias}
is the optional alternate name that redefines the name of the external subroutine. {alias} is separated from {name} by the pipe (|) symbol.
{name}
is the required name of the load module.
{routine}
is the optional name of the subroutine located in the separately compiled module. {name} is separated from {routine} by a semicolon (;).

 

  1. Multiple instances of the same routine may be loaded at the same time by using the {alias} feature.

  2. The module name specified for the EXTERNAL statement is case sensitive. The external subroutine name is not case sensitive.

 

 

See Also: Example Code, CALL, LROUTINE, ROUTINE, XCALL, Compiler Directives

 



PL/B Language Reference EQUATE FDECLARED