comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Record -> Array in Ada
Date: 1996/08/20
Date: 1996-08-20T00:00:00+00:00	[thread overview]
Message-ID: <dewar.840550912@schonberg> (raw)
In-Reply-To: 321991BE.41C67EA6@mailgw.sanders.lockheed.com


Michael asks

"1) Unchecked_Conversion into a fixed size array.  (And if I do this, how
do I get the array bounds set correctly?)

2) Pass Record'Address and Record'Size into a subprogram.  Inside the
subprogram, declare an array of the appropriate size, located at the
appropriate address.  (have prototyped this one, and it works.)
"

method 2 is fine, be sure to use object'size and not type'size when
you do this (they can be different).

method 1 will also work, just declare a local subtype of the appropriate
size for the array, so that the sizes match, you can use 'Size of the
record object to compute the right bounds for the target array subtype.





  parent reply	other threads:[~1996-08-20  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-20  0:00 Record -> Array in Ada Mike Roske
1996-08-20  0:00 ` George Haddad
1996-08-20  0:00 ` Dave Marshall
1996-08-20  0:00   ` Robert I. Eachus
1996-08-20  0:00 ` Robert Dewar [this message]
1996-08-20  0:00 ` Ted Dennison
replies disabled

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