[comp.lang.ada] Conversion to/from Byte Array

mwills@x102a.harris-atd.com (wills ms 01309) (03/15/90)

I need to send and receive several fairly complex (variant) data
structures over a serial port.  I plan to use unchecked conversion
among the data types of interest and a constrained byte array type.

Alsys Ada '286 behaves well in the tests that I've run on types of
equal length.  However, the data types of interest are of various
lengths.  The manual says Alsys will copy only the least significant
bits when the source type is larger than the target, but it doesn't
address the reverse situation.  Is it reversible?  

My byte array will always be at least as large as the data type it
will contain.  I know I could use slices or constrained subtypes, but
the whole thing is much simpler if I can use a fixed length byte array.

Please respond via email if you've done something similar or if you
have a more portable solution.  Thanks.
--

------------------------------------------------------------------------
M. Scott Wills                    internet: mwills@x102a.ess.harris.com
Mail Stop 102-4858                    uucp: uunet!x102a!mwills
Harris Corporation                   phone: 407-729-3283
Government Aerospace Systems Div.     Bldg: 102 Room: 3426
P.O. Box 94000
Melbourne, FL 32902
------------------------------------------------------------------------