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

View \PROCED2.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 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. 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.