comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@escmail.orl.mmc.com>
Subject: Re: Record -> Array in Ada
Date: 1996/08/20
Date: 1996-08-20T00:00:00+00:00	[thread overview]
Message-ID: <321A2A00.167EB0E7@escmail.orl.mmc.com> (raw)
In-Reply-To: 321991BE.41C67EA6@mailgw.sanders.lockheed.com


Mike Roske wrote:
> What's the best way to split the record into 16-bit slices for
> transmission?
> 
> I have identified the following options:
> 
> 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.)
> 
> 3) Ask in c.l.a for suggestions.  (hi there!)
> 

Why not do all three? :-)

Simply merge approaches 1 and 2 (and you are already doing 3). Set the array
type's size to be (Record'size + 7)/8 bytes.

-- 
T.E.D.          
                |  Work - mailto:dennison@escmail.orl.mmc.com  |
                |  Home - mailto:dennison@iag.net              |
                |  URL  - http://www.iag.net/~dennison         |




      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 ` Robert Dewar
1996-08-20  0:00 ` Dave Marshall
1996-08-20  0:00   ` Robert I. Eachus
1996-08-20  0:00 ` Ted Dennison [this message]
replies disabled

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