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

 
Output of file : MOREPROG.MOD contained in archive : M2TUTOR.ZIP
(* Chapter 7 - Program 2 *)
MODULE MoreProg; (* More program construction examples *)

FROM InOut IMPORT WriteString, WriteLn;

CONST MainC = 27;
TYPE MainT = ARRAY[3..7] OF CARDINAL;
VAR MainV : MainT;

PROCEDURE Proc1;
CONST Proc1C = 33;
TYPE Proc1T = ARRAY[-23..-15] OF CHAR;
VAR Proc1V : MainT;
Proc11 : Proc1T;
BEGIN
WriteString("Procedure 1");
WriteLn;
END Proc1;

PROCEDURE Proc2;
CONST Proc2C = 22;
TYPE Proc2T = ARRAY[3..5],[-4..0] OF BOOLEAN;
VAR Proc2V : MainT;
Proc21 : Proc2T;
PROCEDURE Proc3;
CONST Proc3C = -234;
TYPE Proc3T = ARRAY[12..13] OF MainT;
VAR Proc3V : MainT;
Proc31 : Proc2T;
Proc32 : Proc3T;
BEGIN
WriteString("Procedure 3");
WriteLn;
END Proc3;

PROCEDURE Proc4;
CONST Proc4C = 111;
TYPE Proc4T = CARDINAL;
VAR Proc4V : MainT;
Proc41 : Proc2T;
Proc42 : Proc4T;
PROCEDURE Proc5;
CONST Proc5C = "A";
TYPE Proc5T = ARRAY[22..222] OF CHAR;
VAR Proc5V : MainT;
Proc51 : Proc2T;
Proc52 : Proc4T;
Proc53 : Proc5T;
BEGIN
WriteString("Procedure 5");
WriteLn;
END Proc5;
BEGIN
WriteString("Procedure 4");
WriteLn;
Proc5;
Proc3;
END Proc4;
BEGIN
WriteString("Procedure 2");
WriteLn;
Proc3;
Proc4;
END Proc2;

BEGIN
WriteString("Main Program");
WriteLn;
Proc2;
Proc1;
END MoreProg.




(* Result of execution

Main Program
Procedure 2
Procedure 3
Procedure 4
Procedure 5
Procedure 3
Procedure 1

*)



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