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

  1.                                        -- Chapter 8 - Program 2
  2. with Text_IO;
  3. use Text_IO;
  4.  
  5. procedure Proced2 is
  6.  
  7.    package Int_IO is new Text_IO.Integer_IO(INTEGER);
  8.    use Int_IO;
  9.  
  10.    Counter : INTEGER;
  11.  
  12.    procedure Write_A_Header is
  13.    begin
  14.       Counter := 1;
  15.       Put("This is the heading for this little program.");
  16.       New_Line(2);
  17.    end Write_A_Header;
  18.  
  19.    procedure Write_And_Increment is
  20.    begin
  21.       Put("This is line number");
  22.       Put(Counter,2);
  23.       Put_Line(" of this program.");
  24.       Counter := Counter + 1;
  25.    end Write_And_Increment;
  26.  
  27.    procedure Write_An_Ending_Statement is
  28.    begin
  29.       New_Line;
  30.       Put_Line("This is the end of this little program.");
  31.    end Write_An_Ending_Statement;
  32.  
  33. begin
  34.    Write_A_Header;
  35.    for Index in 1..7 loop
  36.       Write_And_Increment;
  37.    end loop;
  38.    Write_An_Ending_Statement;
  39. end Proced2;
  40.  
  41.  
  42.  
  43.  
  44. -- Result of execution
  45.  
  46. -- This is the heading for this little program.
  47. --
  48. -- This is line number 1 of this program.
  49. -- This is line number 2 of this program.
  50. -- This is line number 3 of this program.
  51. -- This is line number 4 of this program.
  52. -- This is line number 5 of this program.
  53. -- This is line number 6 of this program.
  54. -- This is line number 7 of this program.
  55. --
  56. -- This is the end of this little program.
  57.  
  58.