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

 
Output of file : BIGCASE.MOD contained in archive : M2TUTOR.ZIP
(* Chapter 4 - Program 7 *)
MODULE BigCase;

FROM InOut IMPORT WriteString, WriteInt, WriteLn;

VAR Dummy : INTEGER;
Index : INTEGER;

BEGIN

FOR Dummy := 1 TO 7 DO
WriteInt(Dummy,4);
WriteString(" ");
CASE Dummy OF
1,5,6 : IF Dummy > 5 THEN
WriteString("The number is six.");
ELSE
FOR Index := 1 TO Dummy DO
WriteString("XXXXX ");
END;
END; |

2 : FOR Index := 1 TO 5 DO
WriteString(" It is 2 ");
END; |

3,7 : WriteString("It is 3 or 7");
WriteString(" which turns out");
WriteString(" to be very good."); |
ELSE
WriteString("The number 4 will not be used.");
END; (* of CASE *)
WriteLn;
END; (* of FOR loop *)

END BigCase.




(* Result of execution

1 XXXXX
2 It is 2 It is 2 It is 2 It is 2 It is 2
3 It is 3 or 7 which turns out to be very good.
4 The number 4 will not be used.
5 XXXXX XXXXX XXXXX XXXXX XXXXX
6 The number is six.
7 It is 3 or 7 which turns out to be very good.

*)



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