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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,eb64de1902329f4f X-Google-Attributes: gid103376,public From: dmarshal@netcom.com (Dave Marshall) Subject: Re: Record -> Array in Ada Date: 1996/08/20 Message-ID: #1/1 X-Deja-AN: 175293028 sender: dmarshal@netcom13.netcom.com references: <321991BE.41C67EA6@mailgw.sanders.lockheed.com> organization: NETCOM On-line Communication Services (408 261-4700 guest) newsgroups: comp.lang.ada Date: 1996-08-20T00:00:00+00:00 List-Id: Mike Roske writes: [snipped the introduction: need to transmit a record as a number of 16-bit values.] >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?) I've done this rather frequently. The number of words is computed thusly, use whatever stylistics you like: Number_Of_Words : constant := (My_Record_Type'Size + 15) / 16; >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.) *FROWNERZ*, sometimes we are prevented from doing the cool things that work. LRM 13.5(8): "Address clauses should not be used to achieve overlays of objects or overlays or program units. Nor should a given interrupt be linked to more than one entry. Any program using address clauses to achieve such effects is erroneous." -- Dave Marshall dmarshal@netcom.com