comp.lang.ada
 help / color / mirror / Atom feed
From: "chris.danx" <spamoff.danx@ntlworld.com>
Subject: Re: files and character arrays..
Date: Tue, 14 May 2002 08:28:35 +0100
Date: 2002-05-14T08:28:35+01:00	[thread overview]
Message-ID: <c13E8.795$925.139802@news6-win.server.ntlworld.com> (raw)
In-Reply-To: e6a474c.0205131830.1283b0d9@posting.google.com


"devine" <devine@linuxmail.org> wrote in message
news:e6a474c.0205131830.1283b0d9@posting.google.com...
> Hi.  I was wandering if anyone had an example of a program that reads
> in characters into an array from a file?  I have seen many programs
> that read integers but I have not found a program that reads
> characters into an array.

Do you want to read a whole lotof characters at a time, or one at a time?
The functions get and get_line from ada.text_io are useful for this.  Note
that get_line works for strings, while get will work for strings or
characters (and other things).  Check the ada reference manual section
A.10.1 or John English's online book (don't have the link for the book
sorry, try www.adapower.com) for more.

Reading characters from a file is really quite similar to reading integers
from a file.  The code might be (slightly) different, but the principles are
the same.  Look in JEs book, there's probably something in there!

HTH,
Chris





      reply	other threads:[~2002-05-14  7:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-14  2:30 files and character arrays devine
2002-05-14  7:28 ` chris.danx [this message]
replies disabled

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