home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 18 - Program 5
- with Text_IO;
- use Text_IO;
-
- procedure Revers is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- type MY_ARRAY is array(3..10) of INTEGER;
-
- Store_Here : MY_ARRAY := (3, 16, -5, 6, 12, 66, -13, 57);
- Another : MY_ARRAY;
-
- function Reverse_Array(Data : MY_ARRAY) return MY_ARRAY is
- Temp : MY_ARRAY;
- begin
- for Index in Data'RANGE loop
- Temp(Index) := Data(Data'FIRST + Data'LAST - Index);
- end loop;
- return Temp;
- end Reverse_Array;
-
- begin
-
- Another := Reverse_Array(Store_Here);
- Another := Reverse_Array(Another);
-
- end Revers;
-
-
-
-
- -- Result of Execution
-
- -- (No output from this program.)
-
-