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=0.6 required=5.0 tests=BAYES_00,FROM_WORDY,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4afd08be1096008a,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-11 23:00:03 PST From: "Vladimir Bednikov" Newsgroups: comp.lang.ada Subject: converting floats, ints byte arrays Date: Thu, 12 Jul 2001 15:16:29 +0930 Organization: Defence Science and Technology Organisation Message-ID: <9ije24$9kg$1@fang.dsto.defence.gov.au> NNTP-Posting-Host: n21-162.dsto.defence.gov.au X-Trace: fang.dsto.defence.gov.au 994917252 9872 131.185.21.162 (12 Jul 2001 05:54:12 GMT) X-Complaints-To: postmaster@dsto.defence.gov.au NNTP-Posting-Date: 12 Jul 2001 05:54:12 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!crtntx1-snh1.gtei.net!nycmny1-snh1.gtei.net!news.gtei.net!zeus.visi.com!news-out.visi.com!hermes.visi.com!news1.optus.net.au!optus!yorrell.saard.net!fang.dsto.defence.gov.au!not-for-mail Xref: archiver1.google.com comp.lang.ada:9852 Date: 2001-07-12T05:54:12+00:00 List-Id: Hi all, I have a bunch of values I want to send via tcp, instead of converting each to a string and sending it out, I want to store all the values into a byte array, ie: type byte is mod 256; type byte_array is array(integer range <>) of byte; The values are for example, sampleRate : C.C_Float; scalingFactor : C.C_Float; numSamples : C.Unsigned; numSensors : C.Unsigned; positionChanged : C.Unsigned_Char; groupBySensors : C.Unsigned_Char; What I want is an array where the first C.C_Float'size bytes is the sample rate, the next C.C_Float'size bytes is the scaling factor, the next C.Unsigned'size bytes is the number of samples etc and finally send the byte array out via tcp. Does anybody out there know of a way to do this. All help is appreciated, Thanks in advance