comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <marin.condic.auntie.spam@pacemicro.com>
Subject: Re: Reading from a .cfg file
Date: Mon, 18 Jun 2001 15:45:34 -0400
Date: 2001-06-18T19:45:36+00:00	[thread overview]
Message-ID: <9gllp0$gsm$1@nh.pace.co.uk> (raw)
In-Reply-To: bfc234ad.0106180924.3320ef28@posting.google.com

Not being familiar with what a .cfg file is puts me at a disadvantage, but
here's a starting point: From Ada95, you have Stream files which are
basically files of 8-bit bytes which then you have to interpret yourself.
However, this is not backwards compatible to Ada83. (Are you *sure* you want
to support that?) From Ada83, you can kind of get there by using an
instantiation of Sequential_IO with your own data type to represent bytes.
(Upward compatible to Ada95) You then read the file one byte at a time &
translate it as needed. The Ada83 answer may have problems depending on the
OS and underlying file system. It was not intended for reading files as raw
bytes - but you can usually get there from here.

If you provide a bit more detail about what you want to read & how, we might
be able to give you a better answer.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"J J. Rauch" <chemmie@aol.com> wrote in message
news:bfc234ad.0106180924.3320ef28@posting.google.com...
> I am brand new to Ada and i need to write a package to read and parse
> data from a .cfg file.  This package has to be compatible with both
> Ada 83 and Ada 95 as it will be used with programs that are written
> with both versions.
> Any input would be very helpful because I am just starting off with
> Ada now.  I will be writing the package using Apex Ada 95 if that
> matters.
> Thank you,
> J. R.





  reply	other threads:[~2001-06-18 19:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-18 17:24 Reading from a .cfg file J J. Rauch
2001-06-18 19:45 ` Marin David Condic [this message]
2001-08-27  9:19 ` Noam Kloos
2001-08-30 20:07   ` Greg Bek
2001-09-02 15:36     ` Robert Dewar
replies disabled

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