[gtkada] configuration files

manuel.op.de.coul at eon-benelux.com manuel.op.de.coul at eon-benelux.com
Tue May 28 14:36:54 CEST 2002


Preben wrote:
>The program will be writing and reading the settings files so the
>programmer knows the order in which the data comes.

We should allow for people to edit the ini file, including
mixing up the order, IMO. If you read the file in memory and
retrieve by key later this is not a problem. We could check
for duplicate keys.

>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.

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;

(Another reason why the file order shouldn't matter.)

Manuel





More information about the gtkada mailing list