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

 
Output of file : LOCMOD2.MOD contained in archive : M2TUTOR.ZIP
(* Chapter 13 - Program 2 *)
MODULE LocMod2;

FROM InOut IMPORT WriteString, WriteCard, WriteLn;

VAR Index : CARDINAL;

MODULE MyStuff;
IMPORT WriteString, WriteCard, WriteLn;
EXPORT QUALIFIED WriteStuff;
VAR Counter : CARDINAL;
PROCEDURE WriteStuff;
BEGIN
Counter := Counter + 3;
WriteString("The value of the counter is ");
WriteCard(Counter,8);
WriteLn;
END WriteStuff;
BEGIN
Counter := 4;
END MyStuff;

BEGIN (* Main program *)
FOR Index := 1 TO 8 DO
MyStuff.WriteStuff;
END;
END LocMod2.




(* Result of execution

The value of the counter is 7
The value of the counter is 10
The value of the counter is 13
The value of the counter is 16
The value of the counter is 19
The value of the counter is 22
The value of the counter is 25
The value of the counter is 28

*)



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