comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: access type referencing nested array element
Date: 1998/09/19
Date: 1998-09-19T00:00:00+00:00	[thread overview]
Message-ID: <EzJ7JD.KD1.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: EzJ5Gp.JG5.0.-s@inmet.camb.inmet.com

I responded earlier:

: Technobabble (WishList@2600.com) wrote:

: : Ok, that means that if XYZ is a pointer to array of records, I can simply
: : use the pointer with the array index eg. (5) to access the 5th record. 
: : Now if I want to get the address of the 5th record would this be correct:

: : type xyz is access xyz_rec;
                     ^^^ insert "all" here

: : XYZ_POINTER := XYZ (5)'access;

: Yes, presuming the array is declared an an array of *aliased* components.

As indicated above, I forgot to mention that you need to say
"access all" rather than simply "access" if you want to use 'Access 
to create values of your access type.  Without the "all", you can
only use an allocator (new xyz_rec...) to create values of your
access type.

: E.g.:

:    type array_of_rec is array(Positive range <>) of aliased xyz_rec;
:                                                     ^^^^^^^
:                      This is required if you want to use 'Access.

: : ????

: : thanks.
: : Richmond

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




  reply	other threads:[~1998-09-19  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-19  0:00 access type referencing nested array element Technobabble
1998-09-19  0:00 ` Dale Stanbrough
1998-09-19  0:00   ` Technobabble
1998-09-19  0:00     ` Tucker Taft
1998-09-19  0:00       ` Tucker Taft [this message]
1998-09-19  0:00       ` dewarr
1998-09-19  0:00         ` Brian Rogoff
1998-09-20  0:00           ` Dale Stanbrough
1998-09-20  0:00             ` dewarr
replies disabled

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