home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / mod2tutr.zip / EXAMPLES.ZIP / CH14E2.MOD < prev    next >
Text File  |  1989-01-18  |  635b  |  42 lines

  1.                            (* Chapter 14 - Programming exercise 2 *)
  2. MODULE CH14E2;
  3.  
  4. FROM InOut  IMPORT WriteInt, WriteLn;
  5. FROM SYSTEM IMPORT ADR, TSIZE, ADDRESS;
  6.  
  7. VAR BigList : ARRAY[1..100] OF CARDINAL;
  8.     Index   : INTEGER;
  9.     Point   : ADDRESS;
  10.  
  11. BEGIN
  12.  
  13.    FOR Index := 1 TO 100 DO
  14.       BigList[Index] := 200 + Index;
  15.    END;
  16.  
  17.    Point := ADR(BigList[100]);
  18.    FOR Index := 1 TO 8 DO
  19.       WriteInt(INTEGER(Point^),6);
  20.       WriteLn;
  21.       Point := Point - 12 * TSIZE(INTEGER);
  22.    END;
  23.  
  24. END CH14E2.
  25.  
  26.  
  27.  
  28.  
  29. (* Result of execution
  30.  
  31.    300
  32.    288
  33.    276
  34.    264
  35.    252
  36.    240
  37.    228
  38.    216
  39.  
  40. *)
  41.  
  42.