HP Pascal/iX Programmer's Guide (31502-90023)

9- 13
RETURN
END
Calling FORTRAN 66/V from HP Pascal
FORTRAN 66/V is a Compatibility Mode language only. The FORTRAN 66/V
routine that your HP Pascal program calls must reside in a Compatibility
Mode SL, and you must write a switch stub to access it from your HP
Pascal program (see "Switch Stubs" ).
The directive EXTERNAL FORTRAN passes parameters the same way in HP
Pascal as it does in FORTRAN 66/V.
For corresponding HP Pascal and FORTRAN 66/V types, see Table 9-3 in
"Calling FORTRAN 77 from HP Pascal" .
Example
The Pascal program Pass_heap_var calls the external FORTRAN 66/V routine
FORT.
Pascal program:
$HP3000_16$
PROGRAM Pass_heap_var (input,output);
TYPE
ptr = ^arr;
arr = PACKED ARRAY [1..80] OF char;
VAR
aptr : ptr;
PROCEDURE fort (VAR arrptr : arr); EXTERNAL FORTRAN;
BEGIN
new(aptr);
aptr^ := 'I am a dynamic variable';
fort (aptr^);
END.
FORTRAN 66/V routine:
SUBROUTINE FORT(PTRARR)
CHARACTER PTRARR(80)
DISPLAY PTRARR
RETURN
END
Calling SPL from HP Pascal
SPL is a Compatibility Mode language only. The SPL routine that your HP
Pascal program calls must reside in a Compatibility Mode SL, and you must
write a switch stub to access it from your HP Pascal program. The switch
stub cannot be written in SPL. (See "Switch Stubs" .)
The directive EXTERNAL SPL passes parameters the same way in HP Pascal as
it does in Pascal/V.
Table 9-4 matches corresponding HP Pascal and SPL types. (It
contains only the types that are acceptable for formal intrinsic
parameters.) The variable
n
is an integer.