home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LANGUAGE / ADA / LOVELACE / compute.adb < prev    next >
Text File  |  1996-10-01  |  423b  |  21 lines

  1. -- Demonstrate a trivial procedure, with another nested inside.
  2. with Ada.Text_IO, Ada.Integer_Text_IO;
  3. use Ada.Text_IO, Ada.Integer_Text_IO;
  4.  
  5. procedure Compute is
  6.  
  7.  procedure Double(Item : in out Integer) is
  8.  begin -- procedure Double.
  9.    Item := Item * 2;
  10.  end Double;
  11.  
  12.  X : Integer := 1;   -- Local variable X of type Integer.
  13.  
  14. begin -- procedure Compute
  15.  loop
  16.   Put(X);
  17.   New_Line;
  18.   Double(X);
  19.  end loop;
  20. end Compute;
  21.