home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 13 - Program 1
- with Text_IO;
- use Text_IO;
-
- procedure Access1 is
-
- package Int_IO is new Text_IO.Integer_IO(INTEGER);
- use Int_IO;
-
- type POINT_SOMEWHERE is access INTEGER;
- Index,Arrow,There : POINT_SOMEWHERE;
-
- begin
- Index := new INTEGER;
- Index.all := 13;
- Put("The value is");
- Put(Index.all);
- New_Line;
-
- Arrow := new INTEGER;
- Arrow.all := Index.all + 16;
- There := Arrow;
- Put("The values are now");
- Put(Index.all);
- Put(Arrow.all);
- Put(There.all);
- New_Line;
-
- There.all := 21;
- Put("The values are now");
- Put(Index.all);
- Put(Arrow.all);
- Put(There.all);
- New_Line;
-
- end Access1;
-
-
-
-
- -- Result of execution
-
- -- The value is 13
- -- The values are now 13 29 29
- -- The values are now 13 21 21
-
-