*/
Do you receive the Programmer's Heaven newsletter? If not, why not subscribe?
*/

View \PROCED2.PAS

Getting Started with the Pascal tutorial, source

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


(* Chapter 5 - Program 2 *)
program Another_Procedure_Example;

var Count : integer;
    Index : integer;

procedure Print_Data_Out(Puppy : integer);
begin
   Writeln('This is the print routine',Puppy:5);
   Puppy := 12;
end;

procedure Print_And_Modify(var Cat : integer);
begin
   Writeln('This is the print and modify routine',Cat:5);
   Cat := 35;
end;

begin  (* main program *)
   for Count := 1 to 3 do begin
      Index := Count;
      Print_Data_Out(Index);
      Writeln('Back from the print routine, Index =',Index:5);
      Print_And_Modify(Index);
      Writeln('Back from the modify routine, Index =',Index:5);
      Print_Data_Out(Index);
      Writeln('Back from print again and the Index =',Index:5);
      Writeln(* This is just for formatting *)
   end;
end(* of 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.