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-11 18:47:39 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!4.1.16.34!cpk-news-hub1.bbnplanet.com!news.gtei.net!newshub2.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Ada Examples and Problems References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 12 Apr 2001 01:41:51 GMT NNTP-Posting-Host: 24.20.190.201 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 987039711 24.20.190.201 (Wed, 11 Apr 2001 18:41:51 PDT) NNTP-Posting-Date: Wed, 11 Apr 2001 18:41:51 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:6799 Date: 2001-04-12T01:41:51+00:00 List-Id: >It works on a sequential read but not on a non-sequential read. "For direct access, the file is viewed as a set of elements occupying consecutive positions in linear order;..." LRM A.8(3) So each element of a direct access file must be the same size. Since you have owner, dog, owner, dog... where owner and dog are different size records, that won't work. But "Pair" in type Pair is Person : Owner; Animal : Dog; end record; is a constant size record. If you want the N-th owner, or N-th dog, Set_Index(The_File, N); That seems easier than taking the individual byte as the constant size element and then doing arithmetic that you hope gets you to the correct byte position.