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

 
Output of file : LOOPIF.MOD contained in archive : M2TUTOR.ZIP
(* Chapter 4 - Program 3 *)
MODULE LoopIf;

FROM InOut IMPORT WriteString, WriteInt, WriteLn;

VAR Index, Count, Dog : INTEGER;

BEGIN
FOR Index := 1 TO 10 DO
WriteString("Major loop");
WriteInt(Index,3);
IF Index < 7 THEN
FOR Count := 15 TO (15 + Index) DO
WriteString(' XXX');
END;
WriteLn;
ELSE
WriteString(' How many dogs?');
FOR Dog := 1 TO 10 - Index DO
WriteString(" too many");
END;
WriteLn;
END; (* ELSE part of IF statement *)

END (* Major FOR loop *)
END LoopIf.




(* Result of execution

Major loop 1 XXX XXX
Major loop 2 XXX XXX XXX
Major loop 3 XXX XXX XXX XXX
Major loop 4 XXX XXX XXX XXX XXX
Major loop 5 XXX XXX XXX XXX XXX XXX
Major loop 6 XXX XXX XXX XXX XXX XXX XXX
Major loop 7 How many dogs? too many too many too many
Major loop 8 How many dogs? too many too many
Major loop 9 How many dogs? too many
Major loop 10 How many dogs?

*)



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