home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
modula2
/
compiler
/
fst_mod
/
source
/
proced3.mod
< prev
next >
Wrap
Text File
|
1987-02-08
|
669b
|
24 lines
(* Chapter 5 - Program 3 *)
MODULE Proced3;
FROM InOut IMPORT WriteString, WriteCard, WriteLn;
VAR Apple, Orange, Pear, Fruit : CARDINAL;
PROCEDURE AddTheFruit (Value1,Value2 : CARDINAL; (* One-way *)
VAR Total : CARDINAL; (* Two-way *)
Value3 : CARDINAL); (* One-way *)
BEGIN
Total := Value1 + Value2 + Value3;
END AddTheFruit;
BEGIN (* Main Program *)
Apple := 4;
Orange := 7;
Pear := 5;
AddTheFruit(Apple,Pear,Fruit,Orange);
WriteString("The total number of fruits is ");
WriteCard(Fruit,5);
WriteLn;
END Proced3.