*/
Stuck? Need help? Ask questions on our forums.
*/

View \READDATA.PAS

Getting Started with the Pascal tutorial, source

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


(* Chapter 11 - Program 5 *)
program Read_Real_Data_From_A_File;

var  Hot_Dog : text;
     Index   : byte;
     Line_Number : integer;
     Real1,Real2,Real3 : real;

begin  (* main program *)
   Assign(Hot_Dog,'REALDATA.TXT');
   Reset(Hot_Dog);

   for Index := 1 to 7 do begin
      Readln(Hot_Dog,Line_Number,Real1,Real2,Real3);
      Writeln(Line_Number:7,Real1:12:3,Real2:12:3,Real3:12:3);
   end;
   Close(Hot_Dog);
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.