home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 9 - Programming exercise 2
- with Text_IO;
- use Text_IO;
-
- procedure CH09_2 is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- Dog, Cat : INTEGER;
- Pig, Cow : FLOAT;
-
- begin
- My_Loop:
- for Index in 1..10 loop
- Put("The value of Index is");
- Put(Index,3);
-
- declare
- START : constant INTEGER := Index;
- STOP : constant INTEGER := START + 5;
- Count_Stuff : INTEGER;
- begin
- Count_Stuff := START + STOP + Index + 222;
- Put(" --->");
- for Index in START..STOP loop
- Put(My_Loop.Index,5);
- end loop;
- end;
-
- New_Line;
- end loop My_Loop;
-
- end CH09_2;
-
-
-
-
- -- Result of execution
-
- -- The value of Index is 1 ---> 1 1 1 1 1 1
- -- The value of Index is 2 ---> 2 2 2 2 2 2
- -- The value of Index is 3 ---> 3 3 3 3 3 3
- -- The value of Index is 4 ---> 4 4 4 4 4 4
- -- The value of Index is 5 ---> 5 5 5 5 5 5
- -- The value of Index is 6 ---> 6 6 6 6 6 6
- -- The value of Index is 7 ---> 7 7 7 7 7 7
- -- The value of Index is 8 ---> 8 8 8 8 8 8
- -- The value of Index is 9 ---> 9 9 9 9 9 9
- -- The value of Index is 10 ---> 10 10 10 10 10 10
-
-