![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395215x1.png)
8
The FORTRAN subroutine,
FixVec.f
Fixed Arrays
For a
subroutine FixVec ( V, Sum ) integer Sum
integer V(0:8) integer i
Sum = 0
do 2 i = 0, 8
2Sum = Sum + V(i) return
end
The Pascal main program,
FixVecmain.p
The commands to compile and execute FixVec.f and
FixVecmain.p
program FixVecmain(output);
type
VecTyp = array [0..8] of integer;
var
V:VecTyp := [1, 2, 3, 4, 5, 6, 7, 8, 9]; Sum: integer;
procedure fixvec(var XV: VecTyp; var XSum: integer); external fortran;
begin
fixvec(V, Sum); writeln(Sum: 4) end. { FixVecmain }
hostname% f77
fixvec:
hostname% pc FixVec.o FixVecmain.p
45
The | 191 |