Better use Delphi's TRegistryIniFile instead of TRegIniFile, it has more possibilities and it's more compatible with TIniFile.
Also, if you switch from INI files to the registry, you can rewrite your
application with a minimum
of coding changes: only change the code for Create.
IniFile := TIniFile.Create('C:\Software\MyApp');
you code it as:
RegistryIniFile := TRegistryIniFile.Create('Software\MyApp');
Most methods are the same as in TIniFile: ReadString, ReadInteger,
WriteInteger, WriteFloat,..., ReadSection, ReadSections, DeleteKey,
EraseSection, and so on... Don't
worry about what happens behind the scenes: sections are treated as sub-
keys in the registry, and
data entries under a section are treated as ident/data value pairs of that
var RIniFile: TRegistryIniFile; begin RIniFile := TRegistryIniFile.Create('Software\MyApp'); RIniFile.WriteString('Images', C:\Pics\Latest\bird.tif', 'Original image as shot from camera');
The key is created automatically if it doesn't exist already, otherwise you overwrite the existing value(s).
© Copyright 1999-2018