comp.lang.ada
 help / color / mirror / Atom feed
* Init file package avail?
@ 2001-11-30 21:54 Paul F. Pearson
  2001-11-30 23:14 ` Nick Roberts
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Paul F. Pearson @ 2001-11-30 21:54 UTC (permalink / raw)


Is there a package available to handle reading in from an
intialization file? Preferrably, I'd like one that handles sections
(sort of like the Windows INI file format). I started designing one,
but thought I'd make sure I'm not reinventing the wheel. I'm including
what I'd desinged. I like the capabilities, but don't require the
actual "syntax."

------ begin top-of-my-head design ----------
#comments begin with hash (UNIX style)
#for simplicity, I'd require comments to be on a seperate line
[Section 1]
field1 = value1
#note no terminator on above line

[Section 2]
#field name must only be unique within a section
field1 = value2
field2 = [Section 1, field1]
#a value can be a reference to another value. 

------ end top-of-my-head design ----------

I've even thought about having a %use [Section 1] type of syntax to
allow an entire section's fields to be "copied" into another section's
"namespace".



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Init file package avail?
  2001-11-30 21:54 Init file package avail? Paul F. Pearson
@ 2001-11-30 23:14 ` Nick Roberts
  2001-12-01  5:37 ` DuckE
  2001-12-03 15:02 ` Ted Dennison
  2 siblings, 0 replies; 6+ messages in thread
From: Nick Roberts @ 2001-11-30 23:14 UTC (permalink / raw)


This may be redundant, but have you considered keeping your configuration
data in a database? Your program would then retrieve this data using an
appropriate database interface.

The advantages of this approach is that you then have all the data
management facilities of a database system to bring to bear on the
configuration data. This could make it significantly easier to enter, to
print (report on), to query (e.g. to check for errors), to manipulate (e.g.
update computing certain changes), to backup, and so on.

The disadvantages are fairly obvious: you need a database system (deployable
on your targets); you need to know (learn) how to use (and program) the
database system; you need to have an Ada interface to it; and so on.

One other thing I would recommend is to 'pot' your configuration code (e.g.
in a library package) in such a way that switching to a database
implementation (or a different file format, or whatever) won't require
changes to your main code (only to the config package body).

Yet another thought is the use of a 'Comma Separated Variable-length' (CSV)
file format.

--
Best wishes,
Nick Roberts



"Paul F. Pearson" <ppearson@hiwaay.net> wrote in message
news:c1655c76.0111301354.6a4455e5@posting.google.com...
> Is there a package available to handle reading in from an
> intialization file? Preferrably, I'd like one that handles sections
> ...





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Init file package avail?
  2001-11-30 21:54 Init file package avail? Paul F. Pearson
  2001-11-30 23:14 ` Nick Roberts
@ 2001-12-01  5:37 ` DuckE
  2001-12-03 17:54   ` PaulPearson
  2001-12-03 15:02 ` Ted Dennison
  2 siblings, 1 reply; 6+ messages in thread
From: DuckE @ 2001-12-01  5:37 UTC (permalink / raw)


Have you considered using XML?
See:
  http://www.w3schools.com/xml/default.asp

And of course:
http://libre.act-europe.fr/

SteveD

"Paul F. Pearson" <ppearson@hiwaay.net> wrote in message
news:c1655c76.0111301354.6a4455e5@posting.google.com...
> Is there a package available to handle reading in from an
> intialization file? Preferrably, I'd like one that handles sections
> (sort of like the Windows INI file format). I started designing one,
> but thought I'd make sure I'm not reinventing the wheel. I'm including
> what I'd desinged. I like the capabilities, but don't require the
> actual "syntax."
>
> ------ begin top-of-my-head design ----------
> #comments begin with hash (UNIX style)
> #for simplicity, I'd require comments to be on a seperate line
> [Section 1]
> field1 = value1
> #note no terminator on above line
>
> [Section 2]
> #field name must only be unique within a section
> field1 = value2
> field2 = [Section 1, field1]
> #a value can be a reference to another value.
>
> ------ end top-of-my-head design ----------
>
> I've even thought about having a %use [Section 1] type of syntax to
> allow an entire section's fields to be "copied" into another section's
> "namespace".





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Init file package avail?
  2001-11-30 21:54 Init file package avail? Paul F. Pearson
  2001-11-30 23:14 ` Nick Roberts
  2001-12-01  5:37 ` DuckE
@ 2001-12-03 15:02 ` Ted Dennison
  2001-12-03 18:11   ` PaulPearson
  2 siblings, 1 reply; 6+ messages in thread
From: Ted Dennison @ 2001-12-03 15:02 UTC (permalink / raw)


In article <c1655c76.0111301354.6a4455e5@posting.google.com>, Paul F. Pearson
says...
>Is there a package available to handle reading in from an
>intialization file? Preferrably, I'd like one that handles sections

OpenToken ( http://www.telepath.com/dennison/Ted/OpenToken/OpenToken.html ) was
initially written for this purpose. There's nothing in there specifically for
INI files, but it could be coded up fairly easily.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html

No trees were killed in the sending of this message. 
However a large number of electrons were terribly inconvenienced.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Init file package avail?
  2001-12-01  5:37 ` DuckE
@ 2001-12-03 17:54   ` PaulPearson
  0 siblings, 0 replies; 6+ messages in thread
From: PaulPearson @ 2001-12-03 17:54 UTC (permalink / raw)


DuckE <nospam_steved94@home.com> wrote:
>Have you considered using XML?
>See:
>  http://www.w3schools.com/xml/default.asp

>And of course:
>http://libre.act-europe.fr/

TO be honest, I'd never looked at XML before. MY quick perusal today 
doesn't look promising, however. I'd like the input file to be easily 
maintained by non-computer-weenies, and XML looks too complicated. 

>SteveD

>"Paul F. Pearson" <ppearson@hiwaay.net> wrote in message
>news:c1655c76.0111301354.6a4455e5@posting.google.com...
>> Is there a package available to handle reading in from an
>> intialization file? Preferrably, I'd like one that handles sections
>> (sort of like the Windows INI file format). I started designing one,
>> but thought I'd make sure I'm not reinventing the wheel. I'm including
>> what I'd desinged. I like the capabilities, but don't require the
>> actual "syntax."
>>
>> ------ begin top-of-my-head design ----------
>> #comments begin with hash (UNIX style)
>> #for simplicity, I'd require comments to be on a seperate line
>> [Section 1]
>> field1 = value1
>> #note no terminator on above line
>>
>> [Section 2]
>> #field name must only be unique within a section
>> field1 = value2
>> field2 = [Section 1, field1]
>> #a value can be a reference to another value.
>>
>> ------ end top-of-my-head design ----------
>>
>> I've even thought about having a %use [Section 1] type of syntax to
>> allow an entire section's fields to be "copied" into another section's
>> "namespace".




-- 
Paul F. Pearson (ppearson@hiwaay.net)     http://home.hiwaay.net/~ppearson/
"Lord heal our land. Father heal our land. Hear our cry and turn our nation 
back to You" - Heal Our Land, _Magnify The Lord_ (Integrity Music)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Init file package avail?
  2001-12-03 15:02 ` Ted Dennison
@ 2001-12-03 18:11   ` PaulPearson
  0 siblings, 0 replies; 6+ messages in thread
From: PaulPearson @ 2001-12-03 18:11 UTC (permalink / raw)


Ted Dennison <dennison@telepath.com> wrote:
>In article <c1655c76.0111301354.6a4455e5@posting.google.com>, Paul F. Pearson
>says...
>>Is there a package available to handle reading in from an
>>intialization file? Preferrably, I'd like one that handles sections

>OpenToken ( http://www.telepath.com/dennison/Ted/OpenToken/OpenToken.html ) was
>initially written for this purpose. There's nothing in there specifically for
>INI files, but it could be coded up fairly easily.

This sounds like it has promise. Thanks.


>No trees were killed in the sending of this message. 
>However a large number of electrons were terribly inconvenienced.

:-)

-- 
Paul F. Pearson (ppearson@hiwaay.net)     http://home.hiwaay.net/~ppearson/
"Lord heal our land. Father heal our land. Hear our cry and turn our nation 
back to You" - Heal Our Land, _Magnify The Lord_ (Integrity Music)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-12-03 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-30 21:54 Init file package avail? Paul F. Pearson
2001-11-30 23:14 ` Nick Roberts
2001-12-01  5:37 ` DuckE
2001-12-03 17:54   ` PaulPearson
2001-12-03 15:02 ` Ted Dennison
2001-12-03 18:11   ` PaulPearson

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