home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / sampler / 04 / diverse / pushpop.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-04-12  |  317 b   |  24 lines

  1. PROGRAM PushPop;
  2.  
  3. CONST 
  4.   Levels = 5;
  5.  
  6. VAR 
  7.   Depth : Integer;
  8.  
  9. PROCEDURE Dive(VAR Depth : Integer);
  10.  
  11. BEGIN
  12.   Writeln('Push!');
  13.   Writeln('Our depth is now: ',Depth);
  14.   Depth := Depth +1;
  15.   IF Depth <= Levels THEN Dive(Depth);
  16.   Writeln('Pop!')
  17. END;
  18.  
  19.  
  20. BEGIN
  21.   Depth := 1;
  22.   Dive(Depth);
  23. END.
  24.