home *** CD-ROM | disk | FTP | other *** search
- PROGRAM PushPop;
-
- CONST
- Levels = 5;
-
- VAR
- Depth : Integer;
-
- PROCEDURE Dive(VAR Depth : Integer);
-
- BEGIN
- Writeln('Push!');
- Writeln('Our depth is now: ',Depth);
- Depth := Depth + 1;
- IF Depth <= Levels THEN Dive(Depth);
- Writeln('Pop!')
- END;
-
-
- BEGIN
- Depth := 1;
- Dive(Depth)
- END.