HP Pascal/iX Programmer's Guide (31502-90023)
9- 1
Chapter 9 External Routines
An
external routine
is a routine that is not in the compilation unit that
calls it. Its source language can be the same as that of the calling
compilation unit or it can be different. This chapter explains:
* The EXTERNAL directive, which allows an HP Pascal compilation unit
to access an external routine.
* How an HP Pascal program accesses external routines written in C,
COBOL II, FORTRAN 77, FORTRAN 66/V, and SPL.
* How a switch stub allows a Native Mode HP Pascal program to access
an external routine in a Compatibility Mode SL.
* How a program written in C, COBOL II, FORTRAN 66/V, FORTRAN 77, or
SPL accesses an external HP Pascal routine.
EXTERNAL Directive
The EXTERNAL directive allows an HP Pascal compilation unit to access an
external routine (a routine in another compilation unit). The source
code of the external routine can be any one of the following languages:
* HP Pascal
* HP Pascal/V
* HP C
* HP COBOL II
* FORTRAN 66/V
* HP FORTRAN 77
* SPL
Syntax
[C ]
[COBOL ]
EXTERNAL[FORTRAN ]
[FTN77 ]
[SPL ]
[SPL VARIABLE]
Parameters
None The source code of the external routine is HP Pascal or
Pascal/V.
C The source code of the external routine is C. See Table
9-1 for corresponding HP Pascal and C types.
COBOL The source code of the external routine is COBOL II. See
Table 9-2 for corresponding HP Pascal and COBOL II
types.
FORTRAN The source code of the external routine is FORTRAN 66/V.
The compilation unit that makes the call must also
contain the compiler option HP3000_16 (see compiler
options in the
HP Pascal/iX Reference Manual
or the
HP
Pascal/HP-UX Reference Manual
). See Table 9-3 for
corresponding HP Pascal and FORTRAN 66/V types.
FTN77 The source code of the external routine is FORTRAN 77.
See Table 9-3 for corresponding HP Pascal and
FORTRAN 77 types.