192
Pascal 4.0 User’s Guide
8
The
univ
Arrays
The
univ
arrays that are
in
,
out
,
in out
, or
var
parameters pass by
reference.
The FORTRAN subroutine,
UniVec.f
subroutine UniVec ( V, Last, Sum )
integer V(0:2), Last, Sum, i
Sum = 0
do i = 0, Last
Sum = Sum + V(i)
end do
return
end
The Pascal main program,
UniVecmain.p
program UniVec;
type
VecTyp = array [0..9] of integer;
procedure univec(var V:univ VecTyp; in Last: integer;
var Sum: integer); external fortran;
var
Sum: integer;
V: array [0..2] of integer;
begin
V[0] := 7;
V[1] := 8;
V[2] := 9;
univec(V, 2, Sum);
writeln(Sum)
end. { UniVec }
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......