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,d23a9c52d1958b6a,start X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Problem to dramatize packed-array/rep-clause difficulties Date: 1996/03/27 Message-ID: <4jaun6$st6@news2.delphi.com>#1/1 X-Deja-AN: 144425279 organization: Delphi Internet Services Corporation newsgroups: comp.lang.ada Date: 1996-03-27T00:00:00+00:00 List-Id: In <4jankp$30h@ra.nrl.navy.mil> Doug Rogers gave an unaccepted-by-his- compiler solution to a problem. Here is an alternate for his specific problem which at least my compiler accepts - I don't know about Dougs. These are the nine-bit changes, similar logic handles the six bit ones. Its elegance, of course, is in the eye of the beholder. ;) Assume since bits are specified in Intel order that bytes are also, ie, that the low order bit of the second byte is in fact the highest order bit of the first Natural9 value, rather than its lowest order bit. --type High_Res_Data is array (Natural range 0 .. 7) of Natural9; type High_Res_Data is record a:Natural9; b:Natural9; c:Natural9; d:Natural9; e:Natural9; f:Natural9; g:Natural9; h:Natural9; end record; for High_Res_Data use record a at 0 range 0 .. 8; b at 1 range 1 .. 9; c at 2 range 2 .. 10; d at 3 range 3 .. 11; e at 4 range 4 .. 12; f at 5 range 5 .. 13; g at 6 range 6 .. 14; h at 7 range 7 .. 15; end record; for High_Res_Data'size use 72; ... when High => -- for Index in High_Res_Data'range loop -- Put (" Data ("); -- Put (Natural (Index), Width => 1); -- Put (") => "); -- Put (Natural (S.High_Res (Index))); -- New_Line; -- end loop; Put_Line(" Data (0) =>" & Natural9'image(S.High_Res.a)); Put_Line(" Data (1) =>" & Natural9'image(S.High_Res.b)); Put_Line(" Data (2) =>" & Natural9'image(S.High_Res.c)); Put_Line(" Data (3) =>" & Natural9'image(S.High_Res.d)); Put_Line(" Data (4) =>" & Natural9'image(S.High_Res.e)); Put_Line(" Data (5) =>" & Natural9'image(S.High_Res.f)); Put_Line(" Data (6) =>" & Natural9'image(S.High_Res.g)); Put_Line(" Data (7) =>" & Natural9'image(S.High_Res.h)); end case; -----------------------------------