182
Pascal 4.0 User’s Guide
8
Simple Types with the
–xl
Option
With the
-xl
option, match Pascal
real
with FORTRAN
real
and Pascal
integer
with FORTRAN
integer*2
.
You can pass by value using the
%VAL()
feature of FORTRAN.
Type
shortreal
Unlike C, there is no problem with passing
shortreal
value parameters
between Pascal and FORTRAN. They can be passed exactly as in the previous
example, with the Pascal
shortreal
type matching the FORTRAN
real
type.
Arrays
Since FORTRAN cannot pass arrays by value, it cannot pass strings of
characters, fixed arrays, or
univ
arrays by value.
Conformant Arrays
Although Pascal generally passes all value parameters on the stack, the
exception is value-conformant array parameters, which are handled by
creating a copy in the caller environment and passing a pointer to the copy. In
addition, the bounds of the array must be passed. See “Conformant Arrays”
on page 173.
This example is the same as the one in the earlier section, except that the
var
prefix is deleted.
The commands to compile and
execute
SimVal.p
and
SimValmain.f
hostname% pc -c SimVal.p
hostname% f77 SimVal.o SimValmain.f -lpfc -lpc
SimValmain.f:
MAIN:
hostname% a.out
args=111111(If nth digit=1, arg n OK)
Summary of Contents for SunSoft Pascal 4.0
Page 14: ...xiv Pascal 4 0 User s Guide ...
Page 16: ...xvi Pascal 4 0 User s Guide ...
Page 30: ...6 Pascal 4 0 User s Guide 1 ...
Page 160: ...136 Pascal 4 0 User s Guide 6 ...
Page 268: ...244 Pascal 4 0 User s Guide 11 ...
Page 320: ...296 Pascal 4 0 User s Guide B ...
Page 331: ...Index 307 ...
Page 333: ......