Know a good article or link that we're missing? Submit it!

View \PROCED4.PAS

This is the second disk of the PASCAL TUTOR system. It has the

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 *)

corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.