comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Dowie <martin.dowie@btopenworld.com>
Subject: Re: Aliased
Date: Wed, 15 Jun 2005 16:35:17 +0000 (UTC)
Date: 2005-06-15T16:35:17+00:00	[thread overview]
Message-ID: <d8plc5$ius$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com> (raw)
In-Reply-To: <1118851601.345326.86640@g49g2000cwa.googlegroups.com>

nblanpain@hotmail.com wrote:
> Hello,
> 
> I have a probleme with aliased variable :
> 
> -- Specification
> 
> package Test is
> 
> ...
> 
> private
> 
> type T_Toto is ...;
> type A_Toto is acess all T_Toto;
> 
> type T_Test is new T_Object with record
>    Tab : aliased T_Toto;
>    Ptr_Tab : A_Toto;
> end record;
> 
> end Test;
> 
> -- Body
> 
> package body Test is
> 
> ...
> 
> procedure Initialize is
> begin
>    Ptr_Tab := Tab'Access;  -- illegal instruction
> end Initialize;
> 
> ...
> 
> end Test;
> 
> Where is the problem and is there a solution to it?

Tab is a component of a record type "T_Test" but you have not provided a 
data object of such a type.

On the assumption that you are creating a "singleton" data object of 
type "T_Test" within the package body of "Test", you need something
like:

package body Test is

    My_Test_Data : T_Test;

    procedure Initialise is
    begin
       My_Test_Data.Ptr_Tab := My_Test_Data.Tab'Access;
    end Initialise;

end Test;

Cheers

-- Martin



  reply	other threads:[~2005-06-15 16:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-15 16:06 Aliased nblanpain
2005-06-15 16:35 ` Martin Dowie [this message]
2005-06-15 18:56 ` Aliased nblanpain
2005-06-15 21:47   ` Aliased Martin Dowie
2005-06-16  3:15 ` Aliased Steve
2005-06-16 14:03   ` Aliased nblanpain
2005-06-16 19:56     ` Aliased Simon Wright
2005-06-17  7:01       ` Aliased nblanpain
2005-06-17  9:38         ` Aliased Larry Kilgallen
2005-06-19 19:44           ` Aliased nblanpain
2005-06-19 20:33             ` Aliased Jeffrey Carter
2005-06-20  9:34               ` Aliased nblanpain
2005-06-20 16:41                 ` Aliased Jeffrey Carter
2005-06-17  2:15     ` Aliased Jeffrey Carter
2005-06-17  7:02       ` Aliased nblanpain
2005-06-17  2:35     ` Aliased Steve
2005-06-17  7:52       ` Aliased Dmitry A. Kazakov
2005-06-17  4:38     ` Aliased Christoph Grein
2005-06-29 21:10     ` Aliased Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox