comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Ada Examples and Problems
Date: Thu, 12 Apr 2001 01:41:51 GMT
Date: 2001-04-12T01:41:51+00:00	[thread overview]
Message-ID: <zJ7B6.11027$ix4.8083746@news1.rdc1.sfba.home.com> (raw)
In-Reply-To: DOVA6.3493$FD1.403553@news6-win.server.ntlworld.com

>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.



  parent reply	other threads:[~2001-04-12  1:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 13:38 Ada Examples and Problems chris.danx
2001-04-10 17:53 ` chris.danx
2001-04-10 17:57   ` chris.danx
     [not found] ` <ERFA6.2041$FY5.146015@www.newsranger.com>
2001-04-11  9:51   ` chris.danx
2001-04-11 15:34     ` Ted Dennison
2001-04-11 17:18       ` chris.danx
2001-04-11 17:43         ` chris.danx
2001-04-11 19:01           ` Marc A. Criley
2001-04-11 19:56             ` chris.danx
2001-04-12  1:41               ` tmoran
2001-04-12 15:28         ` Ted Dennison
2001-04-12 18:56           ` chris.danx
2001-04-12 19:01             ` chris.danx
2001-04-12 21:47             ` Ted Dennison
2001-04-13  8:40               ` chris.danx
2001-04-12  1:41     ` tmoran [this message]
2001-04-12 10:15       ` chris.danx
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox