home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 8 - Program 2
- with Text_IO;
- use Text_IO;
-
- procedure Proced2 is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- Counter : INTEGER;
-
- procedure Write_A_Header is
- begin
- Counter := 1;
- Put("This is the heading for this little program.");
- New_Line(2);
- end Write_A_Header;
-
- procedure Write_And_Increment is
- begin
- Put("This is line number");
- Put(Counter,2);
- Put_Line(" of this program.");
- Counter := Counter + 1;
- end Write_And_Increment;
-
- procedure Write_An_Ending_Statement is
- begin
- New_Line;
- Put_Line("This is the end of this little program.");
- end Write_An_Ending_Statement;
-
- begin
- Write_A_Header;
- for Index in 1..7 loop
- Write_And_Increment;
- end loop;
- Write_An_Ending_Statement;
- end Proced2;
-
-
-
-
- -- Result of execution
-
- -- This is the heading for this little program.
- --
- -- This is line number 1 of this program.
- -- This is line number 2 of this program.
- -- This is line number 3 of this program.
- -- This is line number 4 of this program.
- -- This is line number 5 of this program.
- -- This is line number 6 of this program.
- -- This is line number 7 of this program.
- --
- -- This is the end of this little program.
-
-