home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / programm / prog2 / incrint.ada < prev    next >
Encoding:
Text File  |  1991-07-01  |  565 b   |  28 lines

  1.                                        -- Chapter 6 - Program 4
  2. with Text_IO;
  3. use Text_IO;
  4.  
  5. procedure IncrInt is
  6.  
  7.    Index : INTEGER;
  8.  
  9. begin
  10.  
  11.    Index := 13;
  12.    Index := INTEGER'POS(Index);          -- Still 13
  13.    Index := INTEGER'VAL(Index);          -- Still 13
  14.    Index := INTEGER'SUCC(Index);         -- Incremented to 14
  15.    Index := INTEGER'PRED(Index);         -- Decremented to 13
  16.  
  17.    Index := Index + 1;       -- preferred method of incrementing
  18.  
  19. end IncrInt;
  20.  
  21.  
  22.  
  23.  
  24. -- Result of execution
  25.  
  26. --   (No output data from this program.)
  27.  
  28.