home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 14 - Program 3
- with Text_IO;
- use Text_IO;
-
- procedure MultOut is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- Numbers, Some_Text, More_Text : FILE_TYPE;
- Index : INTEGER;
-
- begin
-
- Create(Numbers,Out_File,"INTDATA.TXT");
- Create(Some_Text,Out_File,"TEST.TXT");
- Create(More_Text,Out_File,"CHARACTS.TXT");
-
- for Count in 3..5 loop
- Put(Some_Text,"This line goes to the TEST.TXT file.");
- Put(More_Text,"This line goes to the CHARACTS.TXT file.");
- for Count2 in 12..16 loop
- Put(Numbers,Count + Count2);
- end loop;
- New_Line(More_Text);
- New_Line(Numbers,2);
- New_Line(Some_Text);
- end loop;
-
- Put_Line("INTDATA.TXT, TEST.TXT, and CHARACTS.TXT are ready.");
-
- Close(Numbers);
- Close(Some_Text);
- Close(More_Text);
-
- end MultOut;
-
-
-
-
- -- Results of execution
-
-
- -- (Output to the monitor)
- --
- -- INTDATA.TXT, TEST.TXT, and CHARACTS.TXT are ready.
-
-
- -- (Output to the file named INTDATA.TXT)
- --
- -- 15 16 17 18 19
- --
- -- 16 17 18 19 20
- --
- -- 17 18 19 20 21
- --
-
-
- -- (Output to the file named TEST.TXT)
- --
- -- This line goes to the TEST.TXT file.
- -- This line goes to the TEST.TXT file.
- -- This line goes to the TEST.TXT file.
-
-
- -- Output to the file named CHARACTS.TXT)
- --
- -- This line goes to the CHARACTS.TXT file.
- -- This line goes to the CHARACTS.TXT file.
- -- This line goes to the CHARACTS.TXT file.
-
-