home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 14 - Program 6
- with Text_IO;
- use Text_IO;
-
- procedure IntIn is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- Integer_File : FILE_TYPE;
- Index : INTEGER;
-
- begin
-
- Open(Integer_File,In_File,"INTDATA.TXT");
-
- while not End_Of_File(Integer_File) loop
- if End_Of_Line(Integer_File) then
- New_Line;
- Skip_Line(Integer_File);
- else
- Get(Integer_File,Index);
- Put("The value read in is");
- Put(Index);
- New_Line;
- end if;
- end loop;
-
- Close(Integer_File);
-
- end IntIn;
-
-
-
-
- -- Result of execution
-
- -- The value read in is 15
- -- The value read in is 16
- -- The value read in is 17
- -- The value read in is 18
- -- The value read in is 19
- --
- -- The value read in is 16
- -- The value read in is 17
- -- The value read in is 18
- -- The value read in is 19
- -- The value read in is 20
- --
- -- The value read in is 17
- -- The value read in is 18
- -- The value read in is 19
- -- The value read in is 20
- -- The value read in is 21
-
-