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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae40b60d59bcdc4b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-12 08:32:07 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!arclight.uoregon.edu!logbridge.uoregon.edu!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison Sender: usenet@www.newsranger.com References: Subject: Re: Ada Examples and Problems Message-ID: Date: Thu, 12 Apr 2001 15:28:25 GMT NNTP-Posting-Host: 209.208.22.130 X-Complaints-To: abuse@newsranger.com X-Trace: www.newsranger.com 987089305 209.208.22.130 (Thu, 12 Apr 2001 11:28:25 EDT) NNTP-Posting-Date: Thu, 12 Apr 2001 11:28:25 EDT Organization: http://www.newsranger.com Xref: supernews.google.com comp.lang.ada:6822 Date: 2001-04-12T15:28:25+00:00 List-Id: In article , chris.danx says... > > >"Ted Dennison" wrote in message >news:nQ_A6.3185$FY5.218929@www.newsranger.com... >> Ahhhh. You are using indexing to move the file pointer around. You do of >course >> realize that this is completely non-portable, unless you wrote your own >> Dog_Type'Write and Dog_Type'Read routines? > >I did do this. Oh. So you actually wrote code to convert Dog_Type into Stream_Elements and send it to Ada.Streams.Write? That changes things significantly. In that case you do know exactly how many stream elements Dog_Type uses. So its just a simple matter of updating the file index by that many elements (probably *not* 1 though). >If what you've said is correct how then can i write the code so that i don't >need to count each individual entry and hardwire it into the program. It'd >be much nicer if when i changed the types, i could just recompile the >modules without changing the values for the sizes of records. You've already hit upon the answer: Write your own 'Write and 'Read routines, and then your code can properly size itself automaticly. (If this isn't what you did, tell me. I probably can dig up an example of this to post). --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com