Category : Modula II Source Code
Archive   : M2TUTOR.ZIP
Filename : PROCED3.MOD

 
Output of file : PROCED3.MOD contained in archive : M2TUTOR.ZIP
(* 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.




(* Result of execution

The total number of fruits is 16

*)



  3 Responses to “Category : Modula II Source Code
Archive   : M2TUTOR.ZIP
Filename : PROCED3.MOD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/