You seem to be using the term ".ini-file" a little differently than I would.
I suggest if you use an ini file, you should only read and write to it with the ini file functions designed to do just that. For example, when reading an ini file, you use -
Configfile.ReadString('BasicSettings', 'size', 'S')
And the ini file subsystem will search the whole file, not just one particular line, for a 'size' entry under 'BasicSettings'. If it does not find a suitable entry, it applies the default, 'S' and you app can continue quite safely. Your model, at the moment appears to depend on the entries appearing in a particular line of the file and if something else is there, may return any data it finds. Users expect to be able to manually edit an ini file if they need to and most certainly won't respect line numbers.
And perhaps a case statement instead of the confusing if, else ... array would look prettier.
Davo