8
The commands to compile and execute SimVal.p and SimValmain.f
hostname% pc
hostname% f77 SimVal.o SimValmain.f
SimValmain.f:
MAIN: hostname% a.out
args=111111(If nth digit=1, arg n OK)
Simple Types with the
With the
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
This example is the same as the one in the earlier section, except that the var prefix is deleted.
182 | Pascal 4.0 User’s Guide |