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

  1.  
  2. with Stack_Int;
  3. use  Stack_Int;
  4.  
  5. procedure Demo_GS is
  6.  -- Demonstrate the use of the Generic_Stack package by using a
  7.  -- Stack of Integers.
  8.  
  9.  Stack1, Stack2 : Stack;
  10.  Dummy : Integer;
  11. begin
  12.  Push(Stack1, 1); -- Put 1 onto Stack1.
  13.  Push(Stack1, 2); -- Put 2 onto the Stack1.
  14.  Stack2 := Stack1; -- Copy stack1's contents into stack2.
  15.  Pop(Stack2, Dummy); -- Dummy is now 2.
  16.  Pop(Stack2, Dummy); -- Dummy is now 1.
  17.  --  Now Stack2 is empty and Stack1 has two items.
  18. end Demo_GS;
  19.