From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_40,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!lll-winken!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ucsd!helios.ee.lbl.gov!nosc!logicon.com!trantor.harris-atd.com!trantor!mwills From: mwills@x102a.harris-atd.com (wills ms 01309) Newsgroups: comp.lang.ada Subject: Conversion to/from Byte Array Message-ID: Date: 15 Mar 90 15:29:00 GMT Sender: news@trantor.harris-atd.com Organization: Harris Gov't Aerospace Systems Division List-Id: 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 ------------------------------------------------------------------------