From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b56dc2cdde470ff4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-30 13:07:01 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: gab@rational.com (Greg Bek) Newsgroups: comp.lang.ada Subject: Re: Reading from a .cfg file Date: 30 Aug 2001 13:07:00 -0700 Organization: http://groups.google.com/ Message-ID: References: <3b8a0f44.1828305@news.nl.uu.net> NNTP-Posting-Host: 130.213.203.52 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 999202021 30582 127.0.0.1 (30 Aug 2001 20:07:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 30 Aug 2001 20:07:01 GMT Xref: archiver1.google.com comp.lang.ada:12599 Date: 2001-08-30T20:07:01+00:00 List-Id: > 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