[fpc-pascal]Unit to read/parse configuration file

Marco van de Voort marcov at stack.nl
Fri May 16 18:28:22 CEST 2003


> One more question:  My data analysis program needs to parse a
> "command file" to set options, identify variables, determine which
> statistics to compute, etc.  
> 
> I combed the web looking for a GPL'd or BSD'd unit (or code) that
> does this.  I found one simple unit CFG_DEF, a unit for reading INI
> files, and numerous (unusable) Turbo Pascal compiled units.  The
> config code in ptop is closer to what I'm looking for.  
> 
> I'd like a richer set of syntax features than just 'key=value' and if
> someone else has already invented this wheel, I'd would rather use
> that syntax.  Something like the following:
> 
> foo = bar
> foo2 = bar1,bar2,bar3
> foo3
> foo4 -iterations 1 -nostall

As one of my first OOP experiments I wrote a set of classes to build
more specialised configuration file handling on top of.

However, except the original examples, I never needed it much, because my
programming habits changed a bit due to a different job soon after.

See
http://www.stack.nl/~marcov/files/conffile.zip

It's a bit complex, but it comes with examples (and docs even IIRC).
Might need a few small changes since it was written for pre-1.0 FPC.




More information about the fpc-pascal mailing list