home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASSRC.ZIP / PROCED2.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-04  |  2KB  |  59 lines

  1.                                 (* Chapter 5 - Program 2 *)
  2. program Another_Procedure_Example;
  3.  
  4. var Count : integer;
  5.     Index : integer;
  6.  
  7. procedure Print_Data_Out(Puppy : integer);
  8. begin
  9.    Writeln('This is the print routine',Puppy:5);
  10.    Puppy := 12;
  11. end;
  12.  
  13. procedure Print_And_Modify(var Cat : integer);
  14. begin
  15.    Writeln('This is the print and modify routine',Cat:5);
  16.    Cat := 35;
  17. end;
  18.  
  19. begin  (* main program *)
  20.    for Count := 1 to 3 do begin
  21.       Index := Count;
  22.       Print_Data_Out(Index);
  23.       Writeln('Back from the print routine, Index =',Index:5);
  24.       Print_And_Modify(Index);
  25.       Writeln('Back from the modify routine, Index =',Index:5);
  26.       Print_Data_Out(Index);
  27.       Writeln('Back from print again and the Index =',Index:5);
  28.       Writeln;  (* This is just for formatting *)
  29.    end;
  30. end.  (* of main program *)
  31.  
  32.  
  33.  
  34.  
  35. { Result of execution
  36.  
  37. This is the print routine    1
  38. Back from the print routine, Index =    1
  39. This is the print and modify routine    1
  40. Back from the modify routine, Index =   35
  41. This is the print routine   35
  42. Back from print again and the Index =   35
  43.  
  44. This is the print routine    2
  45. Back from the print routine, Index =    2
  46. This is the print and modify routine    2
  47. Back from the modify routine, Index =   35
  48. This is the print routine   35
  49. Back from print again and the Index =   35
  50.  
  51. This is the print routine    3
  52. Back from the print routine, Index =    3
  53. This is the print and modify routine    3
  54. Back from the modify routine, Index =   35
  55. This is the print routine   35
  56. Back from print again and the Index =   35
  57.  
  58. }
  59.