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

 
Output of file : PROCED2.MOD contained in archive : M2TUTOR.ZIP
(* Chapter 5 - Program 2 *)
MODULE Proced2;

FROM InOut IMPORT WriteString, WriteInt, WriteLn;

VAR Stuff : INTEGER;
Thing : INTEGER;

PROCEDURE PrintDataOut(Puppy : INTEGER);
BEGIN
WriteString("The value of Puppy is ");
WriteInt(Puppy,5);
WriteLn;
Puppy := 12;
END PrintDataOut;

PROCEDURE PrintAndModify(VAR Cat : INTEGER);
BEGIN
WriteString("The value of Cat is ");
WriteInt(Cat,5);
WriteLn;
Cat := 37;
END PrintAndModify;

BEGIN (* Main program *)
FOR Stuff := 3 TO 5 DO
Thing := Stuff;
PrintDataOut(Thing);
WriteString("Back from print, data is ");
WriteInt(Thing,5);
WriteLn;
PrintAndModify(Thing);
WriteString("Back from modify, data is ");
WriteInt(Thing,5);
WriteLn;
PrintDataOut(Thing);
WriteString("Back from print, data is ");
WriteInt(Thing,5);
WriteLn;
WriteLn;
END;
END Proced2.




(* Result of execution

The value of Puppy is 3
Back from print, data is 3
The value of Cat is 3
Back from modify, data is 37
The value of Puppy is 37
Back from print, data is 37

The value of Puppy is 4
Back from print, data is 4
The value of Cat is 4
Back from modify, data is 37
The value of Puppy is 37
Back from print, data is 37

The value of Puppy is 5
Back from print, data is 5
The value of Cat is 5
Back from modify, data is 37
The value of Puppy is 37
Back from print, data is 37

*)



  3 Responses to “Category : Modula II Source Code
Archive   : M2TUTOR.ZIP
Filename : PROCED2.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/