*/
Written some cool source code? Upload it to Programmer's Heaven.
*/

View \PROCED4.PAS

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

corner
© 1996-2008 CommunityHeaven LLC. 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.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.