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,cec65b0a3ccd802d X-Google-Attributes: gid103376,public From: Mike Werner Subject: Re: Big-endian vs little-endian Date: 1999/02/06 Message-ID: <36BB9A6E.D472A709@wvu.edu>#1/1 X-Deja-AN: 441276284 Content-Transfer-Encoding: 7bit References: <36B155D2.2E8573BB@wvu.edu> <7982p9$nll$3@plug.news.pipex.net> X-Posted-Path-Was: not-for-mail Content-Type: text/plain; charset=us-ascii X-ELN-Date: 6 Feb 1999 06:29:09 GMT X-ELN-Insert-Date: Fri Feb 5 22:35:05 1999 Organization: Chaos Incorporated Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-06T00:00:00+00:00 List-Id: Nick Roberts wrote: > > I can think of two possible solutions: > > (a) declare a type derived from Interfaces.Integer_8/16/32 etc. (RM95 B.2), > and then apply a Bit_Order representation clause (RM95 13.5.3) to this type; > > (b) use Text_IO instead of Sequential_IO, and input and output the data in > the form of text. I wish I could use (b) - unfortunately this program was for class and we had to use the data file provided by the instructor. I looked at RM 13.5.3 as pointed out in (a) but really did not understand it. I'm very new at Ada, and that LRM is quite a ways over my head. But I'll take a stab and see if I've got the general idea. Here's the relevant data structure: type Sys_type is (Zarya, Unity, PMA1, PMA2); type Subsys_type is (CDH, CT, ECLSS, EPS, GNC, SM); subtype Desc_type is String(1..256); subtype Dur_Min_Type is Integer; subtype Dur_Sec_type is Integer; type Apm_Rec is record Description : Desc_Type; System : Sys_Type; Subsystem : Subsys_Type; Dur_Min : Dur_Min_Type; Dur_Sec : Dur_Sec_Type; end record; The problematic parts were the Apm_Rec.Dur_Min and the Apm_Rec.Dur_Sec - all the others read in just fine. If I'm understanding all this, should I have changed subtype Dur_Min_Type is Integer; subtype Dur_Sec_type is Integer; to subtype Dur_Min_Type is Integer(S'Bit_Order=>Low_Order_First); subtype Dur_Sec_type is Integer(S'Bit_Order=>Low_Order_First); or perhaps High_Order_First - haven't got everything handy at the moment. But the main question is do I have the right syntax and usage? Or am I completely off here? Really the main reason I'm concerned with this is I much prefer to do my assignments on my own computer as opposed to telnetting into the school's server - that telnet connection lags badly enough that most any task requires much patience. If it weren't for that, I probably wouldn't worry about it. I can work around this for future projects (hopefully) the same way I did for this project - I'm just looking for an easier way. And I do appreciate all the pointers so far - I'm reading the LRM as I have the opportunity. Just the slight problem of most of it being well beyond my knowledge level. But I'm working on it. -- Mike Werner KA8YSD | "Where do you want to go today?" ICQ# 12934898 | "As far from Redmond as possible!" '91 GS500E | Morgantown WV | -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GU d-@ s:+ a- C++>$ UL++ P+ L+++ E W++ N++ !o w--- O- !M V-- PS+ PE+ Y+ R+ !tv b+++(++++) DI+ D--- G e*>++ h! r++ y++++ ------END GEEK CODE BLOCK------