Function Return Values - Sun Microsystems SunSoft Pascal 4.0 User Manual

Hewlett-packard user guide printer printer
Table of Contents

Advertisement

6
The Pascal main program,
SimValMain.p
The commands to compile and
execute SimVal.c and
SimValMain.p

Function Return Values

130
program SimVal(output);
var
t: boolean
f: boolean
c: char
si: integer16 := 9;
i: integer
sr: shortreal := 9.9;
r: double
args: integer;
procedure SimVal(
t, f: boolean;
c: char;
si: integer16;
i: integer;
sr: shortreal;
r: double;
var Reply: integer);
external c;
begin
SimVal(t, f, c, si, i, sr, r, args);
writeln(' args = ', args :6 oct);
end.
{ SimVal }
hostname% cc -c SimVal.c
hostname% pc SimVal.o SimValMain.p
hostname% a.out
args=111111
Function return values match types in the same manner as with parameters,
and they pass in much the same way. See "Variable Parameters" on page 94.
The following example shows how to pass simple types.
Pascal 4.0 User's Guide
:= true;
:= false;
:= 'z';
:= 9;
:= 9.9;

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SunSoft Pascal 4.0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents