home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / sampler / 03 / diverse / stackeat.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-09-09  |  827 b   |  49 lines

  1. { STACKEAT.PAS }
  2. {
  3. Description:  Program demonstrating what happens when a routine is called
  4.               recursively, without any checks and balances.
  5.  
  6. Author:       Don Taylor
  7. Date:         4/4/88
  8. Last revised: 04/04/88  10:25
  9. Application:  IBM PC and compatibles; Turbo Pascal 4.0
  10.  
  11. }
  12.  
  13. PROGRAM StackEater;
  14.  
  15. USES
  16.  Crt;
  17.  
  18. {--------------------}
  19.  
  20. PROCEDURE WhatNext;
  21.  
  22. BEGIN
  23.  WRITELN('This message should never appear!')
  24. END; { WhatNext }
  25.  
  26. {--------------------}
  27.  
  28. PROCEDURE WhizBang;
  29.  
  30. VAR
  31.  a,b,c : WORD;
  32.  d     : ARRAY[1..1024] OF INTEGER;
  33.  
  34. BEGIN
  35.  WRITELN('Calling WhizBang...');
  36.  WhizBang;
  37.  WhatNext
  38. END; { WhizBang }
  39.  
  40. {====================}
  41.  
  42. BEGIN { StackEater }
  43.  ClrScr;
  44.  WRITELN('Starting...');
  45.  WhizBang;
  46.  WRITELN('This line will not appear, either...')
  47. END. { StackEater }
  48. 
  49.