Getting Started with the Pascal tutorial, source
Submitted By:
WEBMASTER
Rating:
(Not rated) (
Rate It)
(* Chapter 5 - Program 4 *)
program Scope_Of_Variables;
var Count : integer;
Index : integer;
procedure Print_Some_Data;
var Count, More_Stuff : integer;
begin
Count := 7;
Writeln('In Print_Some_Data Count =',Count:5,
' Index =',Index:5);
end; (* of Print_Some_Data procedure *)
begin (* Main program *)
for Index := 1 to 3 do begin
Count := Index;
Writeln('In main program Count =',Count:5,
' Index =',Index:5);
Print_Some_Data;
Writeln('In main program Count =',Count:5,
' Index =',Index:5);
Writeln;
end; (* Count loop *)
end. (* main program *)