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: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Record -> Array in Ada Date: 1996/08/20 Message-ID: #1/1 X-Deja-AN: 175407625 references: <321991BE.41C67EA6@mailgw.sanders.lockheed.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-08-20T00:00:00+00:00 List-Id: Michael asks "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.) " method 2 is fine, be sure to use object'size and not type'size when you do this (they can be different). method 1 will also work, just declare a local subtype of the appropriate size for the array, so that the sizes match, you can use 'Size of the record object to compute the right bounds for the target array subtype.