home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / programm / prog4 / allgener.ada < prev    next >
Encoding:
Text File  |  1991-07-01  |  1.4 KB  |  59 lines

  1.                                     -- Chapter 28 - Program 3
  2. generic
  3.    type LIMPRIV is limited private;  -- Limited private
  4.    type PRIV is private;             -- Private
  5.    type DISCRETE_TYPE is (<>);       -- Discrete
  6.    type INT_TYPE is range <>;        -- Integer
  7.    type FLOAT_TYPE is digits <>;     -- Floating point
  8.    type FIXED_TYPE is delta <>;      -- Fixed point
  9. procedure AllGener;
  10.  
  11. procedure AllGener is
  12. begin
  13.    null;
  14. end AllGener;
  15.  
  16.  
  17.  
  18.  
  19. generic
  20.    type LIMPRIV is limited private;
  21.    type PRIV is private;
  22.    type DISCRETE_TYPE is (<>);
  23.    type INT_TYPE is range <>;
  24.    type FLOAT_TYPE is digits <>;
  25.    type FIXED_TYPE is delta <>;
  26. procedure AllUsed(Data_In : LIMPRIV;
  27.                   More_Dat : PRIV;
  28.                   List_Of : DISCRETE_TYPE;
  29.                   Index : INT_TYPE;
  30.                   Real_Dat : FLOAT_TYPE;
  31.                   Fix_Dat : FIXED_TYPE);
  32.  
  33. procedure AllUsed(Data_In : LIMPRIV;
  34.                   More_Dat : PRIV;
  35.                   List_Of : DISCRETE_TYPE;
  36.                   Index : INT_TYPE;
  37.                   Real_Dat : FLOAT_TYPE;
  38.                   Fix_Dat : FIXED_TYPE) is
  39.  
  40. Index2 : INT_TYPE := 4;
  41.  
  42. Index3 : INTEGER := 7;
  43.  
  44. type NEW_INTEGER is new INTEGER range 12..34;
  45.  
  46. Small_Int : NEW_INTEGER := 17;
  47.  
  48. begin
  49.    Index2 := Index + INT_TYPE(Index3) + INT_TYPE(Small_Int);
  50. end AllUsed;
  51.  
  52.  
  53.  
  54.  
  55. -- Result of execution
  56.  
  57. -- (No results, this is not executable)
  58.  
  59.