comp.lang.ada
 help / color / mirror / Atom feed
From: "chris.danx" <chris.danx@ntlworld.com>
Subject: Re: Binary Data File - PLEASE HELP
Date: Mon, 26 Mar 2001 15:49:39 +0100
Date: 2001-03-26T15:49:39+01:00	[thread overview]
Message-ID: <%FIv6.31761$Q4.5539631@news2-win.server.ntlworld.com> (raw)
In-Reply-To: J3Iv6.56705$CL6.1997020@telenews.teleline.es

Try using Direct_IO instantiated for type Char, or a mod 'byte' type

i.e.    type byte is mod 256;

then write a procedure

-- read a sequence of bytes upto numb, from file;
-- if reaches EOF first raise exception EOF_Error;
--
procedure fread (file         : in File_Type;
                           bytes     : out byte_array_type;
                           numb    : in Natural);

the procedure simply uses a while loop or a for loop to read from the file
numb times.

-- though i'm not sure how to get an unconstrained array to work for this;

type byte_array_type is array(natural range <>) of byte;

would be ok, but it might not work with the above procedure.  Someone else
will have to help you with that.  I'd be interested to get any number of
bytes out in an unconstrained type.  Anyone know how?

Chris Campbell





  reply	other threads:[~2001-03-26 14:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <n5su6.24687$CL6.767652@telenews.teleline.es>
2001-03-26 14:08 ` Binary Data File - PLEASE HELP Sergio
2001-03-26 14:49   ` chris.danx [this message]
2001-03-26 14:56     ` Marin David Condic
2001-03-26 14:55   ` Marin David Condic
2001-03-26 19:51     ` Ted Dennison
2001-03-26 20:55       ` Marin David Condic
2001-03-26 21:16       ` tmoran
2001-03-26 22:16         ` Marin David Condic
2001-03-26 22:41         ` Ted Dennison
2001-03-26 14:56   ` Ted Dennison
2001-03-26 15:09     ` Marin David Condic
2001-03-26 15:21   ` Martin Dowie
2001-04-05  5:08   ` David Thompson
replies disabled

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