[gtkada] configuration files

Stephen Leake stephen_leake at acm.org
Wed May 29 02:23:25 CEST 2002


manuel.op.de.coul at eon-benelux.com writes:

> >If there is a mistake in the settings file a
> >Program_Error should be raised I think.
> 
> Or make this configurable to the programmer, choose between
> providing a default value, raising an exception, etc.

Yes, programmer choice on error handling is always good.

> I should mention an important property of the package I wrote, which
> is that it reads the ini file during elaboration. This enables you
> to use the values in declarations, like this for example:
> 
> with Prog_Ini;
> package Thing_Pkg is
> 
>   Things : array(1 .. 
>     Prog_Ini.Get_Key("Thing_List_Size", Default => 100)) of Thing;
> 
> end;

Hmm, I hadn't considered that. I was going to require that we _not_
read the file at elaboration, because I'd like the program to be able
to change the search path at run time (for example, get the actual
file name from the command line). It also simplifies debugging if
things are not done at elaboration time.

I guess we could have a generic that allows this choice?

-- 
-- Stephe





More information about the gtkada mailing list