home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 14 - Program 7
- with Text_IO;
- use Text_IO;
-
- procedure PrintOut is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- Turkey : FILE_TYPE;
-
- begin
- -- First we create the file
- Create(Turkey,Out_File,"LPT1");
- -- Then we write to it
- Put(Turkey,"This is a test of turkey");
- New_Line(Turkey);
- Put(Turkey,"and it should work well.");
- New_Line(Turkey,2);
- Put("Half of the turkey test.");
- New_Line;
-
- Set_Output(Turkey); -- Make Turkey the default output
- Put("This is another test of turkey");
- New_Line;
- Put("and it should work well.");
- New_Line(2);
- Put(Standard_Output,"Half of the turkey test.");
- New_Line(Standard_Output);
- Set_Output(Standard_Output); -- Return to the Standard default
-
- Put("Back to the standard default output.");
-
- Close(Turkey);
-
- end PrintOut;
-
-
-
-
- -- Results of execution
-
- -- (Output to the monitor)
- --
- -- Half of the turkey test.
- -- Half of the turkey test.
- -- Back to the standard default output.
-
- -- (Output to the printer)
- --
- -- This is a test of turkey
- -- and it should work well.
- --
- -- This is another test of turkey
- -- and it should work well.
- --
-
-