HP 3000 Manuals

Calling FORTRAN 66/V from HP Pascal [ HP Pascal/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP Pascal/iX Programmer's Guide

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



MPE/iX 5.0 Documentation