RAD Studio
ContentsIndex
PreviousUpNext
Working with ini Files and the System Registry

Many applications use ini files to store configuration information. The VCL/RTL includes two classes for working with ini files: TIniFile and TMemIniFile. Using ini files has the advantage that they can be used in cross-platform applications and they are easy to read and edit. For information on these classes, see Using TIniFile and TMemIniFile for more information. 

Many Windows applications replace the use of ini files with the system Registry. The Windows system Registry is a hierarchical database that acts as a centralized storage space for configuration information. The VCL includes classes for working with the system Registry. Two of these classes, TRegistryIniFile and TRegistry, are discussed here because of their similarity to the classes for working with ini files. 

TRegistryIniFile is useful for cross-platform applications, because it shares a common ancestor (TCustomIniFile) with the classes that work with ini files. If you confine yourself to the methods of the common ancestor (TCustomIniFile) your application can work on both applications with a minimum of conditional code. TRegistryIniFile is discussed in Using TRegistryIniFile

For applications that are not cross-platform, you can use the TRegistry class. The properties and methods of TRegistry have names that correspond more directly to the way the system Registry is organized, because it does not need to be compatible with the classes for ini files. TRegistry is discussed in Using TRegistry.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!