HP SunSoft Pascal 4.0 User Manual

Page 214

Advertising
background image

190

Pascal 4.0 User’s Guide

8

The following example illustrates this method:

The Pascal program,

sun.pas

program Test(input,output);

var

s : string;

procedure mygrout_(var prompt :string; length :integer32); external;

begin

writeln('Starting...');

s := 'Trio Jeepy';

mygrout_(s, 8);

writeln('Ending...')

end.

The FORTRAN subroutine,

mygrout.f

subroutine MyGrout(N)

character*(*)N

write(6,*) N

return

end

The commands to compile and
run this program

hostname% pc -g -c sun.pas

hostname% f77 -g sun.o mygrout.f -lpc

mygrout.f:

mygrout:

hostname% a.out

Starting...

Trio Jee

Ending...

Advertising