*/
Want to see what people are talking about? See the latest forum posts.
*/

View \READINTS.PAS

Getting Started with the Pascal tutorial, source

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


(* Chapter 11 - Program 4 *)
program Read_Integers_From_File;

var Cupcake : text;
    Index   : byte;
    Var1,Var2,Var3,Var4,Var5 : integer;

begin
   Assign(Cupcake,'INTDATA.TXT');
   Reset(Cupcake);

   for Index := 1 to 5 do begin
      Read(Cupcake,Var1,Var2,Var3);
      Writeln(Var1:6,Var2:6,Var3:6);
   end;

   Reset(Cupcake);
   Writeln;
   for Index := 1 to 5 do begin
      Readln(Cupcake,Var1,Var2,Var3);
      Writeln(Var1:6,Var2:6,Var3:6);
   end;

   Reset(Cupcake);
   Writeln;
   for Index := 1 to 5 do begin
      Read(Cupcake,Var1,Var2,Var3,Var4,Var5);
      Writeln(Var1:6,Var2:6,Var3:6,Var4:6,Var5:6);
   end;

   Reset(Cupcake);
   Writeln;
   for Index := 1 to 5 do begin
      Readln(Cupcake,Var1,Var2,Var3,Var4,Var5);
      Writeln(Var1:6,Var2:6,Var3:6,Var4:6,Var5:6);
   end;
   Close(Cupcake);
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.