home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / modula2 / tutorial / programs / locmod2.mod < prev    next >
Text File  |  1993-03-14  |  698b  |  28 lines

  1.                                         (* Chapter 13 - Program 2 *)
  2. MODULE LocMod2;
  3.  
  4. FROM InOut IMPORT WriteString, WriteCard, WriteLn;
  5.  
  6. VAR Index : CARDINAL;
  7.  
  8.      MODULE MyStuff;
  9.      IMPORT WriteString, WriteCard, WriteLn;
  10.      EXPORT QUALIFIED WriteStuff;
  11.      VAR Counter : CARDINAL;
  12.           PROCEDURE WriteStuff;
  13.           BEGIN
  14.              Counter := Counter + 3;
  15.              WriteString("The value of the counter is ");
  16.              WriteCard(Counter,8);
  17.              WriteLn;
  18.           END WriteStuff;
  19.      BEGIN
  20.         Counter := 4;
  21.      END MyStuff;
  22.  
  23. BEGIN      (* Main program *)
  24.    FOR Index := 1 TO 8 DO
  25.       MyStuff.WriteStuff;
  26.    END;
  27. END LocMod2.
  28.