comp.lang.ada
 help / color / mirror / Atom feed
From: gab@rational.com (Greg Bek)
Subject: Re: Reading from a .cfg file
Date: 30 Aug 2001 13:07:00 -0700
Date: 2001-08-30T20:07:01+00:00	[thread overview]
Message-ID: <afb6d339.0108301207.63a69b5f@posting.google.com> (raw)
In-Reply-To: 3b8a0f44.1828305@news.nl.uu.net

> On 18 Jun 2001 10:24:10 -0700, chemmie@aol.com (J J. Rauch) wrote:
> 
> >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.
> 

Seeing you state that you are using Apex Ada 95, I'm guessing
I know what a .cfg file is.

Within Apex configuration files (those with the .cfg) extension
are used to contain a list of views or subsystems.  The format
of the file is simply a text file with a full pathname on
each line.  If the path name doesn't resolve to a valid file/location
then it is ignored by Apex -- this allows you to put comments in the
file.

These files are most commonly used to store the imports for a view
or a subsystem.  But can also be used as input to various Apex commands,
such us Show_Usage (here the .cfg would contain a list of views/subsystems
to be searched).

So to read the .cfg file all you need is Text_Io.  The most likely
subprogram in Text_Io to use will be Get_Line.

You may want to build an abstraction that provides iterator capabilities.

Greg Bek



  reply	other threads:[~2001-08-30 20:07 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
2001-08-27  9:19 ` Noam Kloos
2001-08-30 20:07   ` Greg Bek [this message]
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