-- Chapter 13 - Program 6 with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO; use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO; procedure AcessAll is type BRICK_TYPE is record Length : INTEGER; Width : INTEGER; Height : INTEGER; end record; type ACCESS_INT is access all INTEGER; type ACCESS_FLT is access all FLOAT; type ACCESS_BRICK is access all BRICK_TYPE; Number : INTEGER := 27; Count : aliased INTEGER := 12; Pt_Count : ACCESS_INT; Size : aliased FLOAT := 7.4; Pt_Size : ACCESS_FLT; Brick : aliased BRICK_TYPE := (3, 4, 6); Pt_Brick : ACCESS_BRICK; begin Pt_Count := Count'Access; -- Pt_Count := Number'Access; Illegal - Number not aliased -- Pt_Count := Size'Access; Illegal - Size is FLOAT -- Pt_Count := Brick'Access; Illegal - Brick is BRICK_TYPE Pt_Count.All := Pt_Count.All + 13; Put("The value of Count is now "); Put(Count, 5); New_Line; Pt_Size := Size'Access; Put("The value of Size is now "); Put(Pt_Size.All, 5, 2, 0); New_Line; Pt_Brick := Brick'Access; Put("The brick measures "); Put(Pt_Brick.Length, 5); -- Using the pointer Put(Pt_Brick.Width, 5); -- Using the pointer Put(Brick.Height, 5); -- Using the object New_Line; end AcessAll; -- Result of execution -- -- The value of Count is now 25 -- The value of Size is now 7.40 -- The brick measures 3 4 6