The FORTRAN–Pascal Interface
181
8
See the following example:
The Pascal procedure,
SimVal.p
.
t
,
f
,
c
,
i
,
r
, and
s
are value parameters.
procedure simval_(t, f: boolean; c: char; i: integer;
r: real; s: integer16; var reply: integer);
begin
reply := 0;
{ If nth arg is ok, set nth octal digit to one. }
if t then
reply := reply + 1;
if not f then
reply := reply + 8;
if c = 'z' then
reply := reply + 64;
if i = 9 then
reply := reply + 512;
if r = 9.9 then
reply := reply + 4096;
if s = 9 then
reply := reply + 32768
end; { simval_ }
The FORTRAN main program,
SimValmain.f
logical*1
t, f
character
c
integer*4
i
double precision
d
integer*2
s
integer*4
args
data t / .true. /, f / .false. /, c / 'z' /
& i / 9 /, d / 9.9 /, s / 9 /
call SimVal( %VAL(t), %VAL(f), %VAL(c),
& %VAL(i), %VAL(d), %VAL(s), args )
write( *, 1 ) args
1 format('args=', o6, '(If nth digit=1, arg n OK)')
stop
end
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: ......