home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 10 - Program 2
- with Text_IO;
- use Text_IO;
-
- procedure Slice is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- type MY_ARRAY is array(1..12) of INTEGER;
-
- First, Second : MY_ARRAY;
- Funny : array(1..33) of INTEGER;
-
- begin
-
- for Index in 1..33 loop
- Funny(Index) := 100 + Index * 2;
- end loop;
-
- for Index in 1..12 loop
- First(Index) := Index;
- end loop;
-
- Second(1..5) := First(3..7);
- Second(1..4) := First(6..9);
- Second(7..12) := First(3..8);
- First(2..9) := First(5..12);
-
- First(1..12) := MY_ARRAY(Funny(1..12));
- First(1..12) := MY_ARRAY(Funny(16..27));
-
- for Index in 1..12 loop
- Put("The array named First has the values ");
- Put(First(Index));
- New_Line;
- end loop;
- end Slice;
-
-
-
-
- -- Result of execution
-
- -- The array named First has the values 132
- -- The array named First has the values 134
- -- The array named First has the values 136
- -- The array named First has the values 138
- -- The array named First has the values 140
- -- The array named First has the values 142
- -- The array named First has the values 144
- -- The array named First has the values 146
- -- The array named First has the values 148
- -- The array named First has the values 150
- -- The array named First has the values 152
- -- The array named First has the values 154
-
-