home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / pub / users / Harry / compilers / p11 / tst / call1.pcat < prev    next >
Text File  |  2006-03-05  |  463b  |  23 lines

  1. (* This program tests procedure calling and returning. *)
  2.  
  3. program is
  4.   procedure foo1 () is
  5.       procedure foo2 () is
  6.           begin
  7.             write ("Within foo2...");
  8.             write ("...Leaving foo2");
  9.             return;
  10.           end;
  11.       begin
  12.         write ("Within foo1...");
  13.         foo2 ();
  14.         write ("...Leaving foo1");
  15.         return;
  16.       end;
  17.  
  18.   begin
  19.     write ("Within main...");
  20.     foo1 ();
  21.     write ("...Leaving main");
  22.   end;
  23.