home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pascal / pascsrc.arc / PROCED4.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  787b  |  26 lines

  1.                                 (* Chapter 5 - Program 4 *)
  2. program Scope_Of_Variables;
  3.  
  4. var Count : integer;
  5.     Index : integer;
  6.  
  7. procedure Print_Some_Data;
  8. var Count, More_Stuff : integer;
  9. begin
  10.    Count := 7;
  11.    Writeln('In Print_Some_Data Count =',Count:5,
  12.                                          '  Index =',Index:5);
  13. end; (* of Print_Some_Data procedure *)
  14.  
  15. begin   (* Main program *)
  16.    for Index := 1 to 3 do begin
  17.       Count := Index;
  18.       Writeln('In main program Count  =',Count:5,
  19.                                           '  Index =',Index:5);
  20.       Print_Some_Data;
  21.       Writeln('In main program Count  =',Count:5,
  22.                                           '  Index =',Index:5);
  23.       Writeln;
  24.    end; (* Count loop *)
  25. end. (* main program *)
  26.